Commit 68fd13e
committed
testsuite: fix potential races in t4011-match-duration.t
Problem: There are two potential race conditions in the final test in
t4011-match-duration.t which ensures the internal expiration of the
scheduler resource is adjusted after an expiration update.
1. A check for the default duration of a submitted job assumes the
duration will be strictly less than the instance duration, but if
the job starts within the same second as the instance starttime
then the duration could match exactly the instance duration since
Fluxion deals in whole seconds.
2. The scheduler is notified of the expiration update asynchronously
with respect to the instance update, which is detected in the test
via the resource-update event in the resource.eventlog. This could
result in the second submitted job receiving an unexpected default
duration.
Fix case 1 above by allowing the job duration to match (but not
exceed) the instance duration. Fix case 2 by blocking the test until
the scheduler emits a log message for the duration update.1 parent c5c1fe5 commit 68fd13e
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
15 | 17 | | |
16 | 18 | | |
17 | 19 | | |
| |||
102 | 104 | | |
103 | 105 | | |
104 | 106 | | |
105 | | - | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
| |||
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| 116 | + | |
| 117 | + | |
114 | 118 | | |
115 | 119 | | |
116 | 120 | | |
| |||
0 commit comments