-
Notifications
You must be signed in to change notification settings - Fork 955
fix: resolve race condition in TestWorkspaceAgent/GoogleCloud #18970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing Touches🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
…nt/GoogleCloud The test was flaky due to a race condition where the agent CLI would start and attempt authentication before the HTTP server's handler was fully initialized. The test server starts immediately but the handler is set asynchronously, creating a window where requests return 404. This fix waits for the server to be ready by making a test request to /api/v2/buildinfo before starting the agent, ensuring the HTTP handler is properly set up. Fixes: coder/internal#778
57a24fa
to
f204a89
Compare
What does it mean for the agent not to be "fully inserted into the database"? Does the |
I left this in draft because it was the result of a fix driven by Blink, I wasn't convinced either which is why I haven't tagged anyone yet. Agreed though. |
The test was flaky due to a race condition where the agent CLI would start and attempt Google Cloud instance identity authentication before the agent was fully inserted into the database.
This fix adds a synchronization point that waits for the agent to be properly inserted into the database before starting the agent CLI, eliminating the race condition.
Fixes: coder/internal#778