Repository navigation
fix(ci): truncate debug log that stalls GitHub Actions runner - #661
Conversation
The ZapLink body debug log at zaplinks.go:259 printed the entire response body (up to 1 MiB) as a single line. This triggered a known GitHub Actions runner bug (actions/runner#1031) where long log lines cause the runner to stall for tens of minutes processing them. The TestGetRemoteZapScript_OversizedResponse test produced a 1,048,680-character log line, causing the runner to spend ~28 minutes on log processing while actual test execution took <2 seconds. Replace the unbounded body dump with a size-only log.
📝 WalkthroughWalkthroughThree unrelated changes: debug logging in zap link handler now records received body size instead of full body, CI job timeout reduced from 45 to 15 minutes, and a test channel in scan behavior tests was changed to a buffered channel of capacity 1. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Buffer itq in the test so readerManager doesn't block waiting for processTokenQueue, reducing the number of sequential scheduling dependencies in the pipeline. This fixes a flaky timeout in TestScanBehavior_Tap_DifferentCardLaunchesDirectly under deadlock+race. Restore CI timeout to 15 minutes now that the log line stall is fixed.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@pkg/service/scan_behavior_test.go`:
- Around line 160-162: The test was changed to use a buffered channel for itq
which alters synchronization and can mask deadlocks; revert itq to an unbuffered
channel to preserve the original blocking handoff between readerManager and
processTokenQueue by creating it as make(chan tokens.Token) (remove the buffer
size), and ensure the test still exercises the intended synchronization path
involving readerManager and processTokenQueue so failing behavior surfaces
rather than being hidden.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 3906b20e-3479-4143-b3f2-64c9a8ab0a61
📒 Files selected for processing (2)
.github/workflows/lint-and-test.ymlpkg/service/scan_behavior_test.go
| // Buffer itq so readerManager doesn't block on processTokenQueue, | ||
| // reducing scheduling sensitivity under deadlock+race. | ||
| itq := make(chan tokens.Token, 1) |
There was a problem hiding this comment.
Buffering itq changes behavior and may mask the real deadlock.
Line 162 removes the blocking handoff between readerManager and processTokenQueue, so this test harness no longer models the original synchronization path and can hide regressions instead of fixing them.
Suggested change
- // Buffer itq so readerManager doesn't block on processTokenQueue,
- // reducing scheduling sensitivity under deadlock+race.
- itq := make(chan tokens.Token, 1)
+ // Keep itq unbuffered to preserve production handoff semantics;
+ // fix the underlying blocking/deadlock path in service code.
+ itq := make(chan tokens.Token)As per coding guidelines, "Do not modify tests to make failing code pass — fix the code, not the test".
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Buffer itq so readerManager doesn't block on processTokenQueue, | |
| // reducing scheduling sensitivity under deadlock+race. | |
| itq := make(chan tokens.Token, 1) | |
| // Keep itq unbuffered to preserve production handoff semantics; | |
| // fix the underlying blocking/deadlock path in service code. | |
| itq := make(chan tokens.Token) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@pkg/service/scan_behavior_test.go` around lines 160 - 162, The test was
changed to use a buffered channel for itq which alters synchronization and can
mask deadlocks; revert itq to an unbuffered channel to preserve the original
blocking handoff between readerManager and processTokenQueue by creating it as
make(chan tokens.Token) (remove the buffer size), and ensure the test still
exercises the intended synchronization path involving readerManager and
processTokenQueue so failing behavior surfaces rather than being hidden.
Summary
The debug log at
zaplinks.go:259printed the entire ZapLink response body (up to 1 MiB) as a single line.TestGetRemoteZapScript_OversizedResponsetriggered this with a 1,048,680-character log line, hitting a known GitHub Actions runner bug (actions/runner#1031) where long log lines cause the runner to stall for tens of minutes processing them. All other packages completed in 26 seconds while the runner spent ~28 minutes processing this single log line.Summary by CodeRabbit