Closed wilbaker closed 11 months ago
Thank you for the fix!
Looks like unit test is failing with the latest update. I am unable to repro locally so I'll be adding some additional logging to help debug the failure.
Looks like unit test is failing with the latest update. I am unable to repro locally so I'll be adding some additional logging to help debug the failure.
Unit test is passing again now with the additional logging, if there is anything I should do to reduce the chance of this test being flaky, please let me know. Thanks!
To track down the unit test flakiness, one thing to try is to add a loop around the test logic and let it run 10-20 times locally to see if you can repro with the additional logging.
In reply to: 1865027029
To track down the unit test flakiness, one thing to try is to add a loop around the test logic and let it run 10-20 times locally to see if you can repro with the additional logging.
In reply to: 1865027029
Thanks for this suggestion! I believe I have found a different bug related to a race condition and I'm working on a fix now (will push to this same PR).
The issue is that when using a replay file, RESTler does not wait for the trace DB thread, it has a hard sys.exit(0)
as soon as the sequence has finished.
Every so often this results in the last message being missed in the trace DB
To track down the unit test flakiness, one thing to try is to add a loop around the test logic and let it run 10-20 times locally to see if you can repro with the additional logging. In reply to: 1865027029
Thanks for this suggestion! I believe I have found a different bug related to a race condition and I'm working on a fix now (will push to this same PR).
The issue is that when using a replay file, RESTler does not wait for the trace DB thread, it has a hard
sys.exit(0)
as soon as the sequence has finished.Every so often this results in the last message being missed in the trace DB
Just pushed a fix for this issue. Without the fix, I could consistently hit the race when I would run the unit test 200 times. I am now seeing no failures after running the test 800 times.
With the trace database enabled, RESTler was throwing exceptions when attempting to use a replay file because origin was not being set.
This PR sets the origin to "replay", the same used by replay_sequence here:
https://github.com/microsoft/restler-fuzzer/blob/a2a41d728f974951a9853327a5db0b81e2035bfa/restler/engine/core/sequences.py#L805
Additionally, this PR adds a new
test_trace_database_replay_file
test to help keep this scenario healthy, and it updatestest_trace_database_minimal
to validate the origin in trace database requests.I confirmed the new test fails without the fix in
driver.py