Skip to content

cache: Fix flaky cache walker test

Patrick Steinhardt requested to merge pks-cache-flaky-test into master

One of our disk cache walker tests is currently flaky, where it'll try to write a file into a directory which it has just created, but that directory has already been removed. This raciness has been introduced with the introduction of the testcfg builder, which kicks off the walker via registered config hooks when building the Gitaly config. As a result, the cache walker is already running concurrently when we're creating the directory hierarchy, which causes a race between us writing the file and the walker deleting the directory we just created.

The test has already been aware of this race, which is why the automatic walker had been disabled. But given that the testcfg already kicks off the walker, we now need to do this earlier. The fix is thus easy enough: we just need to move disabling the walker before construction of the Gitaly configuration.

Merge request reports

Loading