You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: resolve coverage generation conflicts with stdio transport
Fix CI coverage generation failures caused by stdio transport test:
Coverage Issue:
- go test -coverprofile with ./... fails when tests capture stdout
- TestRunWithTransport_Stdio uses stdio transport which takes over stdout
- This conflicts with coverage output being written to stdout
- Error: "write /dev/stdout: file already closed"
Solutions Applied:
1. Skip stdio transport test when coverage is enabled (testing.CoverMode())
2. Split coverage generation by package to avoid conflicts
3. Merge coverage files manually in CI workflow
CI Workflow Changes:
- Separate "Run tests" (race detector) from coverage generation
- Generate coverage per package and merge into single file
- Use atomic mode for accurate concurrent coverage
Test Changes (transport_test.go):
- Added coverage detection with testing.CoverMode()
- Skip TestRunWithTransport_Stdio when coverage is enabled
- Test still runs normally without coverage flag
This allows full test coverage reporting while avoiding the stdout
conflict. The stdio transport test is still run during normal testing
and race detection, just skipped during coverage generation.
0 commit comments