Skip to content

fix(ci): truncate debug log that stalls GitHub Actions runner - #661

Merged
wizzomafizzo merged 2 commits into
mainfrom
fix/ci-slow-test-log-line
Apr 13, 2026
Merged

wizzomafizzo merged 2 commits into
mainfrom
fix/ci-slow-test-log-line

Conversation

@wizzomafizzo

@wizzomafizzo wizzomafizzo commented Apr 13, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replace unbounded ZapLink body debug log with a size-only log to fix CI test job taking ~28 minutes

The debug log at zaplinks.go:259 printed the entire ZapLink response body (up to 1 MiB) as a single line. TestGetRemoteZapScript_OversizedResponse triggered 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

  • Chores
    • Reduced CI job maximum runtime to speed pipeline turnaround.
    • Optimized debug logging to record only the size of received zap link bodies instead of full content.
  • Tests
    • Updated test harness to use a buffered token queue to stabilize asynchronous test interactions.

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.
@coderabbitai

coderabbitai Bot commented Apr 13, 2026 •

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Three 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

Cohort / File(s) Summary
Zap link logging
pkg/zapscript/zaplinks.go
Replaced debug log that printed the full zap link body string with structured logging of the body byte size (size = len(body)). No control flow or error handling changes.
CI workflow timeout
.github/workflows/lint-and-test.yml
Reduced ci job timeout-minutes from 45 to 15. No other workflow steps or logic changed.
Test channel buffering
pkg/service/scan_behavior_test.go
Changed itq channel from unbuffered to buffered with capacity 1 (make(chan tokens.Token, 1)), affecting send/receive scheduling in the test harness only.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibble logs and make them neat,
A tiny size is all I greet.
CI trimmed its waiting time,
A buffered hop — test passes fine.
Hooray — a tidy codebase beat! 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes a core fix: changing a debug log that was causing CI runner stalls. The change in zaplinks.go (replacing full body logging with size-only logging) directly addresses the GitHub Actions runner stall issue mentioned in the title.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ci-slow-test-log-line

Comment @coderabbitai help to get the list of available commands and usage tips.

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.
@sentry

sentry Bot commented Apr 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@wizzomafizzo
wizzomafizzo merged commit 237b6bd into main Apr 13, 2026
10 checks passed
@wizzomafizzo
wizzomafizzo deleted the fix/ci-slow-test-log-line branch April 13, 2026 10:00

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between ee9b9c0 and 86500c5.

📒 Files selected for processing (2)
  • .github/workflows/lint-and-test.yml
  • pkg/service/scan_behavior_test.go

Comment on lines +160 to +162
// Buffer itq so readerManager doesn't block on processTokenQueue,
// reducing scheduling sensitivity under deadlock+race.
itq := make(chan tokens.Token, 1)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

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.

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)
🤖 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant