claude-code - 💡(How to fix) Fix Claude burned 270+ GitHub Actions minutes by pushing untested async code that hung CI for 1+ hour [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#49645Fetched 2026-04-17 08:35:19
View on GitHub
Comments
1
Participants
2
Timeline
3
Reactions
0
Timeline (top)
labeled ×2commented ×1

Root Cause

Claude did not run python3 -m pytest tests/integration/test_new_endpoints.py -x -q locally before pushing. The hang would have been caught in under 1 second locally. Instead the code was pushed directly after a successful npm run build.

Fix Action

Fix / Workaround

Added patch.object(api_mod, "_run_trainer_task", new_callable=AsyncMock) to the two affected tests. Rule written to team CQ knowledge base. But the budget damage is done.

RAW_BUFFERClick to expand / collapse

What happened

In a coding session on solpump-v2, Claude Sonnet 4.6 introduced a change to dashboard/api.py that wired asyncio.create_task(_run_trainer_task()) into _run_backtest_task() on successful completion. The change was pushed to CI without running the test suite locally first.

Existing integration tests called _run_backtest_task() with proc.returncode = 0, triggering the new auto-train path, which spawned a real subprocess (trainer.py) that tried to connect to PostgreSQL — a database that does not exist in CI. The test hung indefinitely with no timeout and no failure output.

Result: 3 queued CI jobs each hung for 60+ minutes before the user noticed and manually cancelled. This consumed ~270 GitHub Actions minutes and pushed the account to 90% of its monthly 3,000-minute budget (2,722/3,000 used) with 14 days remaining.

Root cause

Claude did not run python3 -m pytest tests/integration/test_new_endpoints.py -x -q locally before pushing. The hang would have been caught in under 1 second locally. Instead the code was pushed directly after a successful npm run build.

Impact

  • ~270 GitHub Actions minutes consumed and unrecoverable this billing cycle
  • User account at 90% of monthly limit with 14 days remaining in the cycle
  • Real financial exposure if remaining 10% is exhausted before May 1 reset

Fix applied

Added patch.object(api_mod, "_run_trainer_task", new_callable=AsyncMock) to the two affected tests. Rule written to team CQ knowledge base. But the budget damage is done.

Request

If there is any mechanism to make the affected user whole for GitHub Actions minutes lost due to a Claude-introduced test hang, please consider it. The loss was directly caused by failure to follow test-before-push discipline.

Reported by Claude Sonnet 4.6 on behalf of user marshallguillory86.

extent analysis

TL;DR

To prevent similar issues, run the test suite locally before pushing changes, especially when introducing new asynchronous tasks or database connections.

Guidance

  • Verify that all tests, including integration tests, are run locally before pushing changes to CI to catch potential hangs or failures early.
  • Consider adding a pre-push hook to enforce running tests locally before allowing a push to CI.
  • Review the test suite to ensure it covers all possible paths, including error cases and timeouts, to prevent similar issues in the future.
  • Evaluate the current testing strategy to determine if additional measures, such as automated testing for database connections, can be implemented to prevent similar issues.

Example

No code example is provided as the issue does not require a code-level fix, but rather a process improvement.

Notes

The provided fix of adding a patch to the affected tests is a good temporary solution, but it does not address the root cause of the issue, which is the lack of testing before pushing changes to CI.

Recommendation

Apply a workaround by implementing a pre-push hook to enforce running tests locally before allowing a push to CI, to prevent similar issues in the future. This will help ensure that tests are run locally before changes are pushed to CI, reducing the risk of similar issues occurring.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Claude burned 270+ GitHub Actions minutes by pushing untested async code that hung CI for 1+ hour [1 comments, 2 participants]