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

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

Build:
Build:
LAST BUILD BRANCH: release/3.3.0
DEFAULT BRANCH: master
Ran 04 Mar 2026 03:46PM UTC
Files 10
Run time 1s
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.1

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

977 of 1044 relevant lines covered (93.58%)

10.87 hits per line

Source Files on job 22676918636.1
  • Tree
  • List 10
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 22676918636
  • ca3c9400 on github
  • Prev Job for on release/3.3.0 (#19106533211.2)
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