Skip to content

Commit 53aa195

Browse files
committed
test: update, pid/B is no longer assert by Finit if notify != pid
As of Finit v4.6 we no longer assert the PID condition for services declaring themselves as notify != pid. We replace D with a forking service to catch any future regressions in the pidfile plugin. No need to check reload PID of D, it is enough to check PID of C. Also, reduce the number of retries at startup. If we haven't gone up within 10 sec with this tiny config something is really wrong. Signed-off-by: Joachim Wiberg <[email protected]>
1 parent e602111 commit 53aa195

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

test/unexpected-restart.sh

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ TEST_DIR=$(dirname "$0")
1414
test_setup()
1515
{
1616
run "cat >> $FINIT_CONF" <<EOF
17-
service log:stdout name:A serv -np -i A
18-
service log:stdout notify:systemd <pid/A> name:B serv -np -i B -N 0 -- B needs A
19-
service log:stdout notify:systemd <service/B/ready> name:C serv -np -i C -N 0 -- C needs B(service)
20-
service log:stdout notify:systemd <pid/B> name:D serv -np -i D -N 0 -- D needs B(pid)
17+
service log:stdout notify:pid name:A serv -np -i A -- A (pid)
18+
service log:stdout notify:systemd <pid/A> name:B serv -np -i B -N 0 -- B needs A (systemd)
19+
service log:stdout notify:s6 <service/B/ready> name:C serv -np -i C -N 0 -- C needs B (s6)
20+
service log:stdout notify:none <pid/A> name:D type:forking serv -i D -- D needs A (forking)
2121
task <service/C/ready,service/D/ready> name:allup initctl cond set allup -- Everything is up
2222
EOF
2323
say "Test start $(date)"
@@ -41,33 +41,34 @@ run "cat $FINIT_CONF"
4141
sep
4242
run "initctl reload"
4343
run "initctl status"
44+
run "initctl cond dump"
4445
sep
4546

47+
run "initctl debug"
4648
say "waiting for primary startup to complete"
47-
retry 'assert_status allup "done"' 100 1
49+
retry 'assert_status allup "done"' 10 1
4850
assert_status C "running"
4951
oldpid=$(pidof C)
50-
assert_status D "running"
51-
doldpid=$(pidof D)
5252

5353
sep "pre-reload status"
5454
run "initctl status"
55+
run "initctl cond dump"
5556
sep
5657

5758
say "Reload Finit, who gets restarted?"
5859
#run "initctl debug"
5960
run "initctl reload"
6061
sleep 2
6162

63+
sep "post-reload status"
64+
run "initctl status"
65+
run "initctl cond dump"
66+
sep
67+
6268
assert_status A "running"
6369
assert_status B "running"
6470
assert_status C "running"
65-
assert_status D "running"
6671

6772
newpid=$(pidof C)
6873
# shellcheck disable=SC2086
6974
assert "C was not restarted" $oldpid -eq $newpid
70-
71-
dnewpid=$(pidof D)
72-
# shellcheck disable=SC2086
73-
assert "D was not restarted" $doldpid -eq $dnewpid

0 commit comments

Comments
 (0)