Repository navigation
Fix flaky Cloud socket test - #397
Open
cosmicspork wants to merge 1 commit into
Open
cosmicspork wants to merge 1 commit into
cosmicspork wants to merge 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XHBkEgSbkBUq3WBhyvNyXa
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi, I hit a test flake at
foundation::cloud::tests::lines_reach_the_socket_and_a_restarted_socket_receives_the_next_lineincrates/core/src/foundation/cloud.rs. It failed or hung 5 of 18 runs ofcargo test --all-features -p laravel-rust-core --lib. With--skip errors::panicit failed 0 of 30 times. Seeing this is a recurring issue, I thought it deserves a fix PR.pre-release-refinements(#380)bundle-framework-guides(#381)cloud.rs:205harden-validationcloud.rs:205mcp-conformancecloud.rs:205My diagnosis is that if the test drops its handle to the accepted connection while the child process spawned by
errors::panic::tests::only_the_catching_thread_is_quiet_and_only_while_it_catchesbriefly holds the test's socket, the dropped handle doesn't close the connection as expected. Holding atry_clone()of the accepted socket makes the test hang every time.This PR is a test-only change, the framework isn't affected because the real socket's server end lives in another process. I'm proposing a fix using
shutdown(Shutdown::Both)to close the socket itself, so the child process copy no longer matters. This now passes 30 of 30 times, and withtry_clone().I used Claude to assist with the investigation and fix.