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

jeffotoni / quick / 369
88%

Build:
DEFAULT BRANCH: main
Ran 27 Oct 2025 04:37PM UTC
Jobs 1
Files 160
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

06 Oct 2025 05:54PM UTC coverage: 50.747%. Remained the same
369

push

circleci

jeffotoni
fix(middleware/logger): resolve race condition in JSON logger test

Fixed intermittent test failures in TestLoggerMiddlewareJSON caused by
a race condition in the captureOutput helper function.

Changes:
- Modified captureOutput to properly synchronize pipe reading with a
  done channel, ensuring all output is captured before returning
- Changed from channel-based output retrieval to direct buffer access
  with proper synchronization
- Added stderr capture alongside stdout to handle loggers that may
  write to either stream
- Added io.ReadAll(resp.Body) in test cases to ensure response is
  fully consumed before closing the pipe

The race condition occurred because the pipe was being closed and read
before the logger middleware had finished writing its output. This
resulted in empty captures on the first test run (~33% failure rate
with --count=3).

The fix ensures deterministic test behavior by waiting for the reader
goroutine to complete via the done channel before returning the
captured output.

Tests now pass consistently across multiple runs.

4146 of 8170 relevant lines covered (50.75%)

1326.06 hits per line

Jobs
ID Job ID Ran Files Coverage
1 369.1 27 Oct 2025 04:37PM UTC 160
50.75
CircleCI Job
Source Files on build 369
  • Tree
  • List 160
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • CircleCI Build #369
  • dc26fb16 on github
  • Prev Build on main (#368)
  • Next Build on main (#370)
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