Skip to content

Commit

Permalink
t/perf/p7519: add fsmonitor--daemon test cases
Browse files Browse the repository at this point in the history
Repeat all of the fsmonitor perf tests using `git fsmonitor--daemon` and
the "Simple IPC" interface.

Signed-off-by: Jeff Hostetler <[email protected]>
  • Loading branch information
jeffhostetler authored and dscho committed Aug 16, 2021
1 parent 5ab490f commit 41b215e
Showing 1 changed file with 34 additions and 3 deletions.
37 changes: 34 additions & 3 deletions t/perf/p7519-fsmonitor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ test_description="Test core.fsmonitor"
# GIT_PERF_7519_SPLIT_INDEX: used to configure core.splitIndex
# GIT_PERF_7519_FSMONITOR: used to configure core.fsMonitor. May be an
# absolute path to an integration. May be a space delimited list of
# absolute paths to integrations.
# absolute paths to integrations. (This hook or list of hooks does not
# include the built-in fsmonitor--daemon.)
#
# The big win for using fsmonitor is the elimination of the need to scan the
# working directory looking for changed and untracked files. If the file
Expand Down Expand Up @@ -143,10 +144,16 @@ test_expect_success "one time repo setup" '

setup_for_fsmonitor() {
# set INTEGRATION_SCRIPT depending on the environment
if test -n "$INTEGRATION_PATH"
if test -n "$USE_FSMONITOR_DAEMON"
then
git config core.useBuiltinFSMonitor true &&
INTEGRATION_SCRIPT=false
elif test -n "$INTEGRATION_PATH"
then
git config core.useBuiltinFSMonitor false &&
INTEGRATION_SCRIPT="$INTEGRATION_PATH"
else
git config core.useBuiltinFSMonitor false &&
#
# Choose integration script based on existence of Watchman.
# Fall back to an empty integration script.
Expand Down Expand Up @@ -182,7 +189,10 @@ test_perf_w_drop_caches () {
}

test_fsmonitor_suite() {
if test -n "$INTEGRATION_SCRIPT"; then
if test -n "$USE_FSMONITOR_DAEMON"
then
DESC="builtin fsmonitor--daemon"
elif test -n "$INTEGRATION_SCRIPT"; then
DESC="fsmonitor=$(basename $INTEGRATION_SCRIPT)"
else
DESC="fsmonitor=disabled"
Expand Down Expand Up @@ -293,4 +303,25 @@ test_expect_success "setup without fsmonitor" '
test_fsmonitor_suite
trace_stop

#
# Run a full set of perf tests using the built-in fsmonitor--daemon.
# It does not use the Hook API, so it has a different setup.
# Explicitly start the daemon here and before we start client commands
# so that we can later add custom tracing.
#
if test_have_prereq FSMONITOR_DAEMON
then
USE_FSMONITOR_DAEMON=t

trace_start fsmonitor--daemon--server
git fsmonitor--daemon start

trace_start fsmonitor--daemon--client
test_expect_success "setup for fsmonitor--daemon" 'setup_for_fsmonitor'
test_fsmonitor_suite

git fsmonitor--daemon stop
trace_stop
fi

test_done

0 comments on commit 41b215e

Please sign in to comment.