Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix flake on test_path_temporary_files_are_removed (#2059)
I was seeing this test fail in CI (example runs below). It turns out this test has a race condition - the test asserts that the temp file has been deleted, but the temp file is deleted asynchronously on a concurrent.futures.Future.add_done_callback() callback. There is no way to ask a Future to wait until callbacks are finished running (without having the callback itself perform some sort of coordination, which feels like overkill for our needs here). I fixed this with a quick bodge - we test if the file has been deleted, but if it's still there we wait 200ms and try again. It's ugly but it works. Example failures: - https://github.com/replicate/cog/actions/runs/11858411614/job/33048999811 - https://github.com/replicate/cog/actions/runs/11858411614/job/33049000193 - and other jobs on the same workflow run
- Loading branch information