Skip to content

Commit 47cecb4

Browse files
committed
test-lib: clear watchman watches at test completion
Signed-off-by: Derrick Stolee <[email protected]>
1 parent cd717ef commit 47cecb4

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

t/test-lib-functions.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,3 +1475,18 @@ test_set_port () {
14751475
port=$(($port + ${GIT_TEST_STRESS_JOB_NR:-0}))
14761476
eval $var=$port
14771477
}
1478+
1479+
test_clear_watchman () {
1480+
if test $GIT_TEST_FSMONITOR -ne ""
1481+
then
1482+
watchman watch-list |
1483+
grep "$TRASH_DIRECTORY" |
1484+
sed "s/\t\"//g" |
1485+
sed "s/\",//g" >repo-list
1486+
1487+
for repo in $(cat repo-list)
1488+
do
1489+
watchman watch-del "$repo"
1490+
done
1491+
fi
1492+
}

t/test-lib.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,8 @@ test_atexit_handler () {
10721072
# sure that the registered cleanup commands are run only once.
10731073
test : != "$test_atexit_cleanup" || return 0
10741074

1075+
test_clear_watchman
1076+
10751077
setup_malloc_check
10761078
test_eval_ "$test_atexit_cleanup"
10771079
test_atexit_cleanup=:

0 commit comments

Comments
 (0)