This is an archive of the discontinued LLVM Phabricator instance.

[lldb] [test] Add synchronization fix Subprocess test flakiness
ClosedPublic

Authored by mgorny on Sep 9 2021, 3:17 AM.

Details

Summary

Add synchronization routines to ensure that Subprocess tests output
in a predictable order, and all test strings are output before the tests
terminate.

Diff Detail

Event Timeline

mgorny requested review of this revision.Sep 9 2021, 3:17 AM
mgorny created this revision.
mgorny updated this revision to Diff 371554.Sep 9 2021, 4:50 AM

Remove unnecessary child_done pipe, as pointed out by @labath.

mgorny updated this revision to Diff 371571.Sep 9 2021, 6:13 AM

Force sync earlier for fork() and clone() (since we don't have to wait for exec there). Avoid depending on ordering between child output and LLDB exit.

Stress-testing it now.

mgorny added a comment.Sep 9 2021, 6:47 AM

With this version, I haven't been able to reproduce a test failure in 350 iterations, so I guess it's good now.

labath accepted this revision.Sep 9 2021, 11:59 PM

cool, thanks

This revision is now accepted and ready to land.Sep 9 2021, 11:59 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 10 2021, 12:11 AM