]> git.ipfire.org Git - thirdparty/git.git/commit
t7527: decrease likelihood of racing with fsmonitor daemon
authorPatrick Steinhardt <ps@pks.im>
Thu, 18 Jan 2024 10:22:45 +0000 (11:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 18 Jan 2024 19:53:17 +0000 (11:53 -0800)
commitf591a9bfebce123acca44ede12a4327ec1804b65
treec39e2753ab82d58761d2400c15d7ca4aa5844d3e
parent7310fa4a7529ced954d7d53201735ca05e8fd27c
t7527: decrease likelihood of racing with fsmonitor daemon

In t7527, we test that the builtin fsmonitor daemon works well in
various edge cases. One of these tests is frequently failing because
events reported by the fsmonitor--daemon are missing an expected event.
This failure is essentially a race condition: we do not wait for the
daemon to flush out all events before we ask it to quit. Consequently,
it can happen that we miss some expected events.

In other testcases we counteract this race by sending a simple query to
the daemon. Quoting a comment:

  We run a simple query after modifying the filesystem just to introduce
  a bit of a delay so that the trace logging from the daemon has time to
  get flushed to disk.

Now this workaround is not a "proper" fix as we do not wait for all
events to have been synchronized in a deterministic way. But this fix
seems to be sufficient for all the other tests to pass, so it must not
be all that bad.

Convert the failing test to do the same. While the test was previously
failing in about 50% of the test runs, I couldn't reproduce the failure
after the change anymore.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7527-builtin-fsmonitor.sh