8000 Fix ptrace race on Android tests by schopin-mozilla · Pull Request #209 · rust-minidump/minidump-writer · GitHub
[go: up one dir, main page]

Skip to content

Fix ptrace race on Android tests - #209

Merged
marti4d merged 2 commits into
rust-minidump:mainfrom
schopin-mozilla:flakiness-android
Aug 19, 2026
Merged

marti4d merged 2 commits into
rust-minidump:mainfrom
schopin-mozilla:flakiness-android

Conversation

@schopin-mozilla
Copy link
Copy Markdown
Collaborator

The main goal of this PR is to avoid a race when running multiple tests in parallel where they all try to ptrace() the parent and block each other out. I threw in a few output enhancements that I had to do in order to diagnose the issue.

@marti4d marti4d left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh no... We had a mid-air collision on this too! And again -- I just merged this in before I saw yours!

https://github.com/rust-minidump/minidump-writer/blob/main/tests/ptrace_dumper.rs#L47

Sorry about both of these - My fault. I haven't really been communicating that I had to fix these things as part of making my process inspection changes work.

It's funny -- We both ran into some of the same issues with testing doing our work. Our changes aren't even that dissimilar lol.

It looks like you might have taken a less shotgun-y approach here though - Yours might be clearly better. What do you think? Fix the merge conflicts and still do this instead?

You can't have multiple children attaching to the parent at the same
time, this forces serialization of this part of the tests.

I would often see failures on my Android emulator because of this.
Funnily enough the issue wasn't triggered on desktop Linux because the
tests run through `cargo run` which adds enough delay to avoid the race
window.

This replaces the previous approach that relied on each test explicitly
taking out the lock.
@Jake-Shadle
Jake-Shadle removed their request for review August 18, 2026 12:37
@schopin-mozilla
Copy link
Copy Markdown
Collaborator Author

Sure! I do love that not only did we end up with the same solution, but we also had the same side-quest of getting the output sorted out!
Rebased, and I took the liberty of removing your approach to avoid duplication.

@marti4d marti4d left a comment
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perfect 💯

Thanks for doing this -- My way was... significantly crappier than this lol.

@marti4d
marti4d merged commit 03f5836 into rust-minidump:main Aug 19, 2026
16 checks passed
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

0