• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

snowplow / snowplow-golang-tracker / 22676918636
94%
master: 94%

Build:
Build:
LAST BUILD BRANCH: release/3.3.0
DEFAULT BRANCH: master
Ran 04 Mar 2026 03:46PM UTC
Jobs 3
Files 10
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Mar 2026 03:43PM UTC coverage: 93.582% (+0.3%) from 93.26%
22676918636

Pull #91

github

web-flow
Fix race conditions in Emitter for concurrent usage (Close #90)

PR #89
* test: enable race detection in test suite
Enables Go's race detector (-race flag) when running tests to detect
data races in concurrent code. Also switches coverage mode to 'atomic'
which is required when using race detection.

This change exposes existing race conditions in the emitter implementation
that occur during concurrent use of the tracker.

* fix: add mutex protection to eliminate race conditions in Emitter

Fixes multiple race conditions that occur when Emitter is used concurrently:

1. SendChannel race: Added sync.Mutex to protect SendChannel access in
   start() and Stop(). The check-then-create pattern was causing races
   when multiple goroutines called these methods simultaneously.

2. Configuration field races: Added sync.RWMutex to protect concurrent
   access to configuration fields (CollectorUrl, RequestType, ByteLimitGet,
   ByteLimitPost). The doSend() method now reads these fields under lock
   before processing events, and all setter methods use proper locking.

3. Test cleanup races: Added Emitter.Stop() calls in tests that use
   httpmock to ensure all emitter goroutines complete before mock cleanup,
   preventing races in test infrastructure.

The Emitter can now be safely used from multiple goroutines without
data races. All changes maintain backward compatibility with the existing API.

* fix: race edge case in Stop()

If "start" is called while we wait for the lock, we would get an orphaned channel

---------

Co-authored-by: João Pereira <jpereira@gitlab.com>
Pull Request #91: Release 3.3.0

67 of 67 new or added lines in 1 file covered. (100.0%)

977 of 1044 relevant lines covered (93.58%)

32.62 hits per line

Jobs
ID Job ID Ran Files Coverage
1 22676918636.1 04 Mar 2026 03:46PM UTC 10
93.58
GitHub Action Run
2 22676918636.2 04 Mar 2026 03:46PM UTC 10
93.58
GitHub Action Run
3 22676918636.3 04 Mar 2026 03:46PM UTC 10
93.58
GitHub Action Run
Source Files on build 22676918636
  • Tree
  • List 10
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Pull Request #91
  • PR Base - master (#19106533211)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc