This is an archive of the discontinued LLVM Phabricator instance.

Rewrite the flaky test_restart_bug test in a more deterministic way
ClosedPublic

Authored by labath on Feb 6 2018, 6:09 AM.

Details

Summary

The test was trying to reproduce a bug in handling of two concurrent
events, which was impossible to do reliably in a black-box style test.
In practice, this meant the test was only ever failing on remote
targets, as these were slow enough to trigger this.

Fortunately, we now have the ability to mock the server side of the
connection, which means we can simulate the failure deterministically,
so I rewrite the test to use the new gdb-client framework.

I've needed to add a couple of new packets to the mock server to be able
to do this. Instead of trying to guess how a "typical" gdb-client test
will want to handle this, I throw an exception in the implementation to
force the user to override them (the packets are only sent if the test
explicitly performs some action which will trigger them, so a basic test
which e.g. does not need the "continue" functionality will not need to
implement them).

Diff Detail

Repository
rL LLVM

Event Timeline

labath created this revision.Feb 6 2018, 6:09 AM

Looks good to me

This revision was not accepted when it landed; it landed in state Needs Review.Feb 8 2018, 2:41 AM
This revision was automatically updated to reflect the committed changes.