t7527: improve implicit shutdown testing in fsmonitor--daemon
commit3294ca6140875163b538eab08b56d1c8b3ccca5b
authorJeff Hostetler <jeffhost@microsoft.com>
Thu, 26 May 2022 21:47:24 +0000 (26 21:47 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 26 May 2022 22:59:28 +0000 (26 15:59 -0700)
tree07852d1bf2ad1905c99f6031ef7fcb94e771b804
parent53fcfbc84f68d11c9635fe58f72ce5a83200e051
t7527: improve implicit shutdown testing in fsmonitor--daemon

Refactor the tests that exercise implicit shutdown cases
to make them more robust and less racy.

The fsmonitor--daemon will implicitly shutdown in a variety
of situations, such as when the ".git" directory is deleted
or renamed.

The existing tests would delete or rename the directory, sleep
for one second, and then check the status of the daemon.  This
is racy, since the client/status command has no way to sync
with the daemon.  This was noticed occasionally on very slow
CI build machines where it would cause a random test to fail.

Replace the simple sleep with a sleep-and-retry loop.

Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7527-builtin-fsmonitor.sh