t/perf/p7519: add fsmonitor--daemon test cases

Repeat all of the fsmonitor perf tests using `git fsmonitor--daemon` and the "Simple IPC" interface. Signed-off-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff Hostetler committed Mar 25, 2022 at 18:03 UTC ad2b54e3e89d715a283a3c3ab6262c9bed8cb3a1
1 file changed +34 -4
t/perf/p7519-fsmonitor.sh
+34 -4
@@ -141,7 +141,7 @@ test_expect_success "one time repo setup" '
141 fi
142 '
143
144 -setup_for_fsmonitor () {
144 +setup_for_fsmonitor_hook () {
145 # set INTEGRATION_SCRIPT depending on the environment
146 if test -n "$INTEGRATION_PATH"
147 then
@@ -182,7 +182,11 @@ test_perf_w_drop_caches () {
182 }
183
184 test_fsmonitor_suite () {
185 - if test -n "$INTEGRATION_SCRIPT"; then
185 + if test -n "$USE_FSMONITOR_DAEMON"
186 + then
187 + DESC="builtin fsmonitor--daemon"
188 + elif test -n "$INTEGRATION_SCRIPT"
189 + then
190 DESC="fsmonitor=$(basename $INTEGRATION_SCRIPT)"
191 else
192 DESC="fsmonitor=disabled"
@@ -261,11 +265,11 @@ test_fsmonitor_suite () {
265 trace_start fsmonitor-watchman
266 if test -n "$GIT_PERF_7519_FSMONITOR"; then
267 for INTEGRATION_PATH in $GIT_PERF_7519_FSMONITOR; do
264 - test_expect_success "setup for fsmonitor $INTEGRATION_PATH" 'setup_for_fsmonitor'
268 + test_expect_success "setup for fsmonitor $INTEGRATION_PATH" 'setup_for_fsmonitor_hook'
269 test_fsmonitor_suite
270 done
271 else
268 - test_expect_success "setup for fsmonitor" 'setup_for_fsmonitor'
272 + test_expect_success "setup for fsmonitor hook" 'setup_for_fsmonitor_hook'
273 test_fsmonitor_suite
274 fi
275
@@ -293,4 +297,30 @@ test_expect_success "setup without fsmonitor" '
297 test_fsmonitor_suite
298 trace_stop
299
300 +#
301 +# Run a full set of perf tests using the built-in fsmonitor--daemon.
302 +# It does not use the Hook API, so it has a different setup.
303 +# Explicitly start the daemon here and before we start client commands
304 +# so that we can later add custom tracing.
305 +#
306 +if test_have_prereq FSMONITOR_DAEMON
307 +then
308 + USE_FSMONITOR_DAEMON=t
309 +
310 + test_expect_success "setup for builtin fsmonitor" '
311 + trace_start fsmonitor--daemon--server &&
312 + git fsmonitor--daemon start &&
313 +
314 + trace_start fsmonitor--daemon--client &&
315 +
316 + git config core.fsmonitor true &&
317 + git update-index --fsmonitor
318 + '
319 +
320 + test_fsmonitor_suite
321 +
322 + git fsmonitor--daemon stop
323 + trace_stop
324 +fi
325 +
326 test_done