Skip to content

Commit 065492d

Browse files
jeffhostetlerdscho
authored andcommitted
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 <[email protected]>
1 parent f8013f4 commit 065492d

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

t/perf/p7519-fsmonitor.sh

Lines changed: 34 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
@@ -143,10 +144,16 @@ test_expect_success "one time repo setup" '
143144

144145
setup_for_fsmonitor() {
145146
# set INTEGRATION_SCRIPT depending on the environment
146-
if test -n "$INTEGRATION_PATH"
147+
if test -n "$USE_FSMONITOR_DAEMON"
147148
then
149+
git config core.useBuiltinFSMonitor true &&
150+
INTEGRATION_SCRIPT=false
151+
elif test -n "$INTEGRATION_PATH"
152+
then
153+
git config core.useBuiltinFSMonitor false &&
148154
INTEGRATION_SCRIPT="$INTEGRATION_PATH"
149155
else
156+
git config core.useBuiltinFSMonitor false &&
150157
#
151158
# Choose integration script based on existence of Watchman.
152159
# Fall back to an empty integration script.
@@ -182,7 +189,10 @@ test_perf_w_drop_caches () {
182189
}
183190

184191
test_fsmonitor_suite() {
185-
if test -n "$INTEGRATION_SCRIPT"; then
192+
if test -n "$USE_FSMONITOR_DAEMON"
193+
then
194+
DESC="builtin fsmonitor--daemon"
195+
elif test -n "$INTEGRATION_SCRIPT"; then
186196
DESC="fsmonitor=$(basename $INTEGRATION_SCRIPT)"
187197
else
188198
DESC="fsmonitor=disabled"
@@ -293,4 +303,25 @@ test_expect_success "setup without fsmonitor" '
293303
test_fsmonitor_suite
294304
trace_stop
295305

306+
#
307+
# Run a full set of perf tests using the built-in fsmonitor--daemon.
308+
# It does not use the Hook API, so it has a different setup.
309+
# Explicitly start the daemon here and before we start client commands
310+
# so that we can later add custom tracing.
311+
#
312+
if test_have_prereq FSMONITOR_DAEMON
313+
then
314+
USE_FSMONITOR_DAEMON=t
315+
316+
trace_start fsmonitor--daemon--server
317+
git fsmonitor--daemon start
318+
319+
trace_start fsmonitor--daemon--client
320+
test_expect_success "setup for fsmonitor--daemon" 'setup_for_fsmonitor'
321+
test_fsmonitor_suite
322+
323+
git fsmonitor--daemon stop
324+
trace_stop
325+
fi
326+
296327
test_done

0 commit comments

Comments
 (0)