Skip to content

Commit b7c715d

Browse files
committed
TestListJobs: fix flakiness
In some cases, TestListJobs fails like this: methods_test.go:712: oneshot.service job not found in list This happens because 'ExecStart=/bin/sh sleep 400' doesn't really run sleep; it merely fails. So, the job is queued and then ExecStart fails instantly, and if the test checks the job status after the failure, the test fails. Fix the ExecStart. While at it, - fix unit description; - remove ExecStartPost as it's useless (and also wrong). Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 73f6754 commit b7c715d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fixtures/oneshot.service

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[Unit]
2-
Description=start stop test
2+
Description=list jobs test
33

44
[Service]
5-
ExecStart=/bin/sh sleep 400
6-
ExecStopPost=/bin/sh sleep 1000
75
Type=oneshot
6+
ExecStart=/bin/sleep 30

0 commit comments

Comments
 (0)