Skip to content

Commit 9159c21

Browse files
jeffhostetlerdscho
authored andcommitted
p7519: add fsmonitor--daemon
Repeat all of the fsmonitor perf tests using `git fsmonitor--daemon` and the "Simple IPC" interface. Signed-off-by: Jeff Hostetler <[email protected]>
1 parent c61d640 commit 9159c21

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

t/perf/p7519-fsmonitor.sh

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ test_description="Test core.fsmonitor"
2424
# GIT_PERF_7519_SPLIT_INDEX: used to configure core.splitIndex
2525
# GIT_PERF_7519_FSMONITOR: used to configure core.fsMonitor. May be an
2626
# absolute path to an integration. May be a space delimited list of
27-
# absolute paths to integrations.
27+
# absolute paths to integrations. (This hook or list of hooks does not
28+
# include the built-in fsmonitor--daemon.)
2829
#
2930
# The big win for using fsmonitor is the elimination of the need to scan the
3031
# working directory looking for changed and untracked files. If the file
@@ -135,10 +136,16 @@ test_expect_success "one time repo setup" '
135136

136137
setup_for_fsmonitor() {
137138
# set INTEGRATION_SCRIPT depending on the environment
138-
if test -n "$INTEGRATION_PATH"
139+
if test -n "$USE_FSMONITOR_DAEMON"
139140
then
141+
git config core.useBuiltinFSMonitor true &&
142+
INTEGRATION_SCRIPT=false
143+
elif test -n "$INTEGRATION_PATH"
144+
then
145+
git config core.useBuiltinFSMonitor false &&
140146
INTEGRATION_SCRIPT="$INTEGRATION_PATH"
141147
else
148+
git config core.useBuiltinFSMonitor false &&
142149
#
143150
# Choose integration script based on existence of Watchman.
144151
# Fall back to an empty integration script.
@@ -174,7 +181,10 @@ test_perf_w_drop_caches () {
174181
}
175182

176183
test_fsmonitor_suite() {
177-
if test -n "$INTEGRATION_SCRIPT"; then
184+
if test -n "$USE_FSMONITOR_DAEMON"
185+
then
186+
DESC="builtin fsmonitor--daemon"
187+
elif test -n "$INTEGRATION_SCRIPT"; then
178188
DESC="fsmonitor=$(basename $INTEGRATION_SCRIPT)"
179189
else
180190
DESC="fsmonitor=disabled"
@@ -285,4 +295,30 @@ test_expect_success "setup without fsmonitor" '
285295
test_fsmonitor_suite
286296
trace_stop
287297

298+
#
299+
# Run a full set of perf tests using the built-in fsmonitor--daemon.
300+
# It does not use the Hook API, so it has a different setup.
301+
# Explicitly start the daemon here and before we start client commands
302+
# so that we can later add custom tracing.
303+
#
304+
305+
test_lazy_prereq HAVE_FSMONITOR_DAEMON '
306+
git version --build-options | grep "feature:" | grep "fsmonitor--daemon"
307+
'
308+
309+
if test_have_prereq HAVE_FSMONITOR_DAEMON
310+
then
311+
USE_FSMONITOR_DAEMON=t
312+
313+
trace_start fsmonitor--daemon--server
314+
git fsmonitor--daemon start
315+
316+
trace_start fsmonitor--daemon--client
317+
test_expect_success "setup for fsmonitor--daemon" 'setup_for_fsmonitor'
318+
test_fsmonitor_suite
319+
320+
git fsmonitor--daemon stop
321+
trace_stop
322+
fi
323+
288324
test_done

0 commit comments

Comments
 (0)