Skip to content

fix: Race condition in workflow server startup#148

Open
mrwind-up-bird wants to merge 2 commits intoSimplyLiz:developfrom
mrwind-up-bird:autofix/b3cf0967/race-condition-in-workflow-ser
Open

fix: Race condition in workflow server startup#148
mrwind-up-bird wants to merge 2 commits intoSimplyLiz:developfrom
mrwind-up-bird:autofix/b3cf0967/race-condition-in-workflow-ser

Conversation

@mrwind-up-bird
Copy link
Collaborator

AutoFix: Race condition in workflow server startup

Category: bug
Severity: medium

Issue

The scheduled-refresh.yml workflow uses 'sleep 2' to wait for server startup, which is unreliable. The server might not be ready, causing subsequent API calls to fail.

Fix

Replaced the unreliable 'sleep 2' with a proper health check loop that waits for the CKB server to become ready. The fix uses exponential backoff (1s for first 10 attempts, then 2s) with a maximum of 30 attempts (40s total) to ensure the server is actually ready before proceeding with API calls. This prevents race conditions where the server might still be starting up when subsequent API calls are made.


Generated by nyxCore AutoFix

@codecov
Copy link

codecov bot commented Mar 19, 2026

Codecov Report

❌ Patch coverage is 53.79630% with 998 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/ckb/setup.go 0.0% 161 Missing ⚠️
internal/suggest/analyzer.go 53.6% 142 Missing and 12 partials ⚠️
internal/testgap/analyzer.go 12.3% 140 Missing and 2 partials ⚠️
internal/query/compound_refactor.go 37.1% 105 Missing and 15 partials ⚠️
internal/query/prepare_rename.go 0.0% 70 Missing ⚠️
internal/mcp/server.go 19.1% 51 Missing and 4 partials ⚠️
internal/mcp/tool_impls_compound.go 46.3% 41 Missing and 10 partials ⚠️
internal/query/prepare_move.go 63.1% 32 Missing and 6 partials ⚠️
internal/audit/analyzer.go 21.0% 30 Missing ⚠️
internal/query/compound.go 25.0% 24 Missing and 3 partials ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff            @@
##           develop    #148     +/-   ##
=========================================
+ Coverage     45.1%   45.6%   +0.5%     
=========================================
  Files          350     367     +17     
  Lines        59747   61934   +2187     
=========================================
+ Hits         26961   28274   +1313     
- Misses       30960   31744    +784     
- Partials      1826    1916     +90     
Flag Coverage Δ
unit 45.6% <53.7%> (+0.5%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants