Skip to content

Commit 3232e30

Browse files
author
Release Manager
committed
gh-38825: Fix two tests that fail on a heavily-loaded machine The commit messages explain each change in detail, but tl;dr these two tests fail for me when the machine is under heavy load because they are guessing how long it will take some computation to complete and the guess is wrong. URL: #38825 Reported by: Michael Orlitzky Reviewer(s): Tobias Diez
2 parents 2af7613 + a181883 commit 3232e30

File tree

2 files changed

+1
-12
lines changed

2 files changed

+1
-12
lines changed

src/sage/parallel/decorate.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,6 @@ def fork(f=None, timeout=0, verbose=False):
516516
517517
sage: @fork(timeout=0.1, verbose=True)
518518
....: def g(n, m): return factorial(n).ndigits() + m
519-
sage: g(5, m=5)
520-
8
521519
sage: g(10^7, m=5)
522520
Killing subprocess ... with input ((10000000,), {'m': 5}) which took too long
523521
'NO DATA (timed out)'

src/sage/parallel/map_reduce.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,21 +1136,12 @@ def start_workers(self):
11361136
sage: from sage.parallel.map_reduce import RESetMapReduce
11371137
sage: def children(x):
11381138
....: print(f"Starting: {x}", flush=True)
1139-
....: sleep(float(0.5))
1140-
....: print(f"Finished: {x}", flush=True)
11411139
....: return []
11421140
sage: S = RESetMapReduce(roots=[1, 2], children=children)
11431141
sage: S.setup_workers(2)
1144-
sage: S.start_workers(); sleep(float(0.4))
1142+
sage: S.start_workers(); sleep(float(5)) # long time
11451143
Starting: ...
11461144
Starting: ...
1147-
sage: [w.is_alive() for w in S._workers]
1148-
[True, True]
1149-
sage: sleep(float(1.5))
1150-
Finished: ...
1151-
Finished: ...
1152-
sage: [not w.is_alive() for w in S._workers]
1153-
[True, True]
11541145
11551146
Cleanup::
11561147

0 commit comments

Comments
 (0)