This solves a flaky test on Windows.
We have similar logic elsewhere for log files. I considered trying to combine them, but since they are methods of different objects, there wasn't really a clean approach.
Differential D18912
sleep and retry on failure to delete temp file in tests amccarth on Apr 8 2016, 3:13 PM. Authored by
Details This solves a flaky test on Windows. We have similar logic elsewhere for log files. I considered trying to combine them, but since they are methods of different objects, there wasn't really a clean approach.
Diff Detail Event TimelineComment Actions How about add a function to lldbsuite\support\fs.py? def remove_file(file, num_retries, sleep_duration): Then just call this everywhere you need to. Could even nuke this whole RemoveTempFile method. Comment Actions Consolidated the os.remove and os.unlink calls with a function to do the retries. Tested on Windows. |
I think the default for num_retries should be 0. Usually you just want to try once without retry.