Commit a181883
committed
src/sage/parallel/map_reduce.py: reduce test dependency on CPU speed
The test we have for start_workers() is doing a bit more than
that. It's starting two threads that each print something, sleep for a
bit, and then print something else. To check the expected output, we
are basically guessing how long it will take these threads to run, and
on a very heavily-loaded machine, we can guess wrong:
File "src/sage/parallel/map_reduce.py", line 1149, in
sage.parallel.map_reduce.RESetMapReduce.start_workers
Failed example:
sleep(float(1.5))
Expected:
Finished: ...
Finished: ...
Got:
Finished: 2
(We were expecting both threads to finish within 1.5s, but only one
did.)
To make this a bit more robust, we eliminate the sleep() and
subsequent print inside of the threads. As a result, we need only make
one guess: how long it will take the threads to start. And for that we
now go overkill and wait 5s.1 parent b60d912 commit a181883
1 file changed
+1
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1136 | 1136 | | |
1137 | 1137 | | |
1138 | 1138 | | |
1139 | | - | |
1140 | | - | |
1141 | 1139 | | |
1142 | 1140 | | |
1143 | 1141 | | |
1144 | | - | |
| 1142 | + | |
1145 | 1143 | | |
1146 | 1144 | | |
1147 | | - | |
1148 | | - | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
1153 | | - | |
1154 | 1145 | | |
1155 | 1146 | | |
1156 | 1147 | | |
| |||
0 commit comments