git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/5] t7527: decrease likelihood of racing with fsmonitor daemon

From
Patrick Steinhardt <ps@pks.im>
Date
Jan 18, 2024, 10:22 UTC
Message-ID
<554b1c85463306809a3503622ec6927165e2f4c2.1705573336.git.ps@pks.im>
In-Reply-To
<cover.1705573336.git.ps@pks.im>

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>
---
 t/t7527-builtin-fsmonitor.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/t7527-builtin-fsmonitor.sh b/t/t7527-builtin-fsmonitor.sh
index 78503158fd..363f9dc0e4 100755
--- a/t/t7527-builtin-fsmonitor.sh
+++ b/t/t7527-builtin-fsmonitor.sh
@@ -978,7 +978,7 @@ test_expect_success !UNICODE_COMPOSITION_SENSITIVE 'Unicode nfc/nfd' '
 	mkdir test_unicode/nfd &&
 	mkdir test_unicode/nfd/d_${utf8_nfd} &&
 
-	git -C test_unicode fsmonitor--daemon stop &&
+	test-tool -C test_unicode fsmonitor-client query --token 0 &&
 
 	if test_have_prereq UNICODE_NFC_PRESERVED
 	then
-- 
2.43.GIT
Previous: Patrick SteinhardtNext: Patrick Steinhardt
Message 10 of 17 in “ci: add support for macOS to GitLab CI”
  1. 0/3 ci: add support for macOS to GitLab CIPatrick Steinhardt, Jan 15, 2024
  2. 1/3 ci: make p4 setup on macOS more robustPatrick Steinhardt, Jan 15, 2024
  3. Matthias AßhauerJan 18, 2024
  4. Patrick SteinhardtJan 18, 2024
  5. 2/3 Makefile: detect new Homebrew location for ARM-based MacsPatrick Steinhardt, Jan 15, 2024
  6. 3/3 ci: add macOS jobs to GitLab CIPatrick Steinhardt, Jan 15, 2024
  7. Phillip WoodJan 16, 2024
  8. Patrick SteinhardtJan 17, 2024
  9. 0/5 ci: add support for macOS to GitLab CIPatrick Steinhardt, Jan 18, 2024
  10. 1/5 t7527: decrease likelihood of racing with fsmonitor daemonPatrick Steinhardt, Jan 18, 2024
  11. 2/5 Makefile: detect new Homebrew location for ARM-based MacsPatrick Steinhardt, Jan 18, 2024
  12. 3/5 ci: handle TEST_OUTPUT_DIRECTORY when printing test failuresPatrick Steinhardt, Jan 18, 2024
  13. 4/5 ci: make p4 setup on macOS more robustPatrick Steinhardt, Jan 18, 2024
  14. 5/5 ci: add macOS jobs to GitLab CIPatrick Steinhardt, Jan 18, 2024
  15. Phillip WoodJan 21, 2024
  16. Patrick SteinhardtJan 22, 2024
  17. Junio C HamanoJan 22, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.