-
Notifications
You must be signed in to change notification settings - Fork 239
test: flakiness improvements #1124
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
103f6b6
test(data-channel): make sendAsync a barrier in drop-oldest tests
pblazej f2c2020
test(support): bound next(within:) without cancelling the UniFFI read
pblazej 570c59a
test(participant): time out via completer reset, not wiped info
pblazej 8225df9
ci: dump test-host threads and tasks when the log stalls
pblazej 6eadda3
ci: stop retrying failed tests
pblazej 13058e3
fix(async): resume AsyncCompleter waiters outside its lock
pblazej fcfea97
test(async): box the completer deadlock test by wall clock
pblazej File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| patch type="fixed" "Fix a deadlock when a `waitUntilActive` / `waitUntilAnyActive` timeout fired at the moment the wait was cancelled, which could hang the app's task and a timer thread" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #!/bin/bash | ||
| # Usage: stall-dump.sh <log-file> <out-dir> [stall-seconds] | ||
| # | ||
| # Watches <log-file>; each time it stops growing for <stall-seconds>, dumps every test host into | ||
| # <out-dir>: a thread sample (a blocked thread) and the Swift concurrency runtime's task tree with | ||
| # async backtraces (a suspended task, which no thread sample can show). Up to three dumps, then exits. | ||
| log=$1; out=$2; stall=${3:-300} | ||
| last=-1; quiet=0; dumps=0 | ||
| while sleep 10; do | ||
| size=$(stat -f%z "$log" 2>/dev/null || echo 0) | ||
| if [ "$size" != "$last" ]; then last=$size; quiet=0; continue; fi | ||
| quiet=$((quiet + 10)) | ||
| [ "$quiet" -lt "$stall" ] && continue | ||
| quiet=0; dumps=$((dumps + 1)); mkdir -p "$out" | ||
| pids=$(pgrep -x xctest); [ -z "$pids" ] && pids=$(pgrep -x xcodebuild) | ||
| for pid in $pids; do | ||
| ps -o pid=,ppid=,etime=,command= -p "$pid" >> "$out/$dumps-processes.txt" | ||
| sample "$pid" 5 -file "$out/$dumps-sample-$pid.txt" >/dev/null 2>&1 | ||
| swift-inspect dump-concurrency "$pid" > "$out/$dumps-tasks-$pid.txt" 2>&1 | ||
| done | ||
| [ "$dumps" -ge 3 ] && exit 0 | ||
| done | ||
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 Simulator hangs omit test-host dumps
When simulator tests stall,
pgrep -x xctestfalls back toxcodebuild. Simulator bundles run inside app test hosts, so dumps omit the hung process.Learn more
Simulator tests use a runner application process rather than the command-line
xctestexecutable. Exact process names depend on the test bundle, while this workflow selects several bundles and platforms. Falling back toxcodebuildcaptures the orchestrator instead of the process executing the stalled test.Example: An iOS
LiveKitCoreTestscase hangs inside its runner app. No process is named exactlyxctest, so onlyxcodebuildis sampled and the blocked test stack is absent.Recommended fix: Discover test-host descendants of the active
xcodebuildprocess, including simulator runner applications and macOS test hosts. Dump each matching descendant rather than relying on the executable name.Was this helpful? React with 👍 or 👎 to provide feedback.