Skip to content

Commit d24a561

Browse files
committed
fixup! git-p4: use test_atexit to kill the daemon
Turns out that there are problems with that approach that are totally not related to Azure Pipelines, so in order to focus on the latter, let's skip the test_atexit patches for now. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 6b3d21c commit d24a561

36 files changed

+147
-3
lines changed

t/lib-git-p4.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ cli="$TRASH_DIRECTORY/cli"
7474
git="$TRASH_DIRECTORY/git"
7575
pidfile="$TRASH_DIRECTORY/p4d.pid"
7676

77+
# Sometimes "prove" seems to hang on exit because p4d is still running
78+
cleanup () {
79+
if test -f "$pidfile"
80+
then
81+
kill -9 $(cat "$pidfile") 2>/dev/null && exit 255
82+
fi
83+
}
84+
trap cleanup EXIT
85+
7786
# git p4 submit generates a temp file, which will
7887
# not get cleaned up if the submission fails. Don't
7988
# clutter up /tmp on the test machine.
@@ -132,7 +141,6 @@ start_p4d () {
132141
# p4d failed to start
133142
return 1
134143
fi
135-
test_atexit kill_p4d
136144

137145
# build a p4 user so [email protected] has an entry
138146
p4_add_user author

t/t0000-basic.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@ check_sub_test_lib_test_err () {
138138
)
139139
}
140140

141-
cat >/dev/null <<\DDD
142141
test_expect_success 'pretend we have a fully passing test suite' "
143142
run_sub_test_lib_test full-pass '3 passing tests' <<-\\EOF &&
144143
for i in 1 2 3
@@ -825,7 +824,6 @@ test_expect_success 'tests clean up even on failures' "
825824
> 1..2
826825
EOF
827826
"
828-
DDD
829827

830828
test_expect_success 'test_atexit is run' "
831829
test_must_fail run_sub_test_lib_test \

t/t9800-git-p4-basic.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,4 +326,8 @@ test_expect_success 'submit from worktree' '
326326
)
327327
'
328328

329+
test_expect_success 'kill p4d' '
330+
kill_p4d
331+
'
332+
329333
test_done

t/t9801-git-p4-branch.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,4 +610,8 @@ test_expect_success 'Update a file in git side and submit to P4 using client vie
610610
)
611611
'
612612

613+
test_expect_success 'kill p4d' '
614+
kill_p4d
615+
'
616+
613617
test_done

t/t9802-git-p4-filetype.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,4 +333,8 @@ test_expect_success SYMLINKS 'empty symlink target' '
333333
)
334334
'
335335

336+
test_expect_success 'kill p4d' '
337+
kill_p4d
338+
'
339+
336340
test_done

t/t9803-git-p4-shell-metachars.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,8 @@ test_expect_success 'branch with shell char' '
105105
)
106106
'
107107

108+
test_expect_success 'kill p4d' '
109+
kill_p4d
110+
'
111+
108112
test_done

t/t9804-git-p4-label.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,4 +108,8 @@ test_expect_failure 'two labels on the same changelist' '
108108
)
109109
'
110110

111+
test_expect_success 'kill p4d' '
112+
kill_p4d
113+
'
114+
111115
test_done

t/t9805-git-p4-skip-submit-edit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,8 @@ test_expect_success 'no config, edited' '
9898
)
9999
'
100100

101+
test_expect_success 'kill p4d' '
102+
kill_p4d
103+
'
104+
101105
test_done

t/t9806-git-p4-options.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,4 +300,9 @@ test_expect_success 'use --git-dir option and GIT_DIR' '
300300
test_path_is_file "$git"/cli_file2.t
301301
'
302302

303+
304+
test_expect_success 'kill p4d' '
305+
kill_p4d
306+
'
307+
303308
test_done

t/t9807-git-p4-submit.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,4 +542,8 @@ test_expect_success 'submit --update-shelve' '
542542
)
543543
'
544544

545+
test_expect_success 'kill p4d' '
546+
kill_p4d
547+
'
548+
545549
test_done

0 commit comments

Comments
 (0)