Skip to content

Commit

Permalink
sagemathgh-38825: Fix two tests that fail on a heavily-loaded machine
Browse files Browse the repository at this point in the history
    
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: sagemath#38825
Reported by: Michael Orlitzky
Reviewer(s): Tobias Diez
  • Loading branch information
Release Manager committed Oct 22, 2024
2 parents 80b203c + a181883 commit 47bd349
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 0 additions & 2 deletions src/sage/parallel/decorate.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,8 +516,6 @@ def fork(f=None, timeout=0, verbose=False):
sage: @fork(timeout=0.1, verbose=True)
....: def g(n, m): return factorial(n).ndigits() + m
sage: g(5, m=5)
8
sage: g(10^7, m=5)
Killing subprocess ... with input ((10000000,), {'m': 5}) which took too long
'NO DATA (timed out)'
Expand Down
11 changes: 1 addition & 10 deletions src/sage/parallel/map_reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -1136,21 +1136,12 @@ def start_workers(self):
sage: from sage.parallel.map_reduce import RESetMapReduce
sage: def children(x):
....: print(f"Starting: {x}", flush=True)
....: sleep(float(0.5))
....: print(f"Finished: {x}", flush=True)
....: return []
sage: S = RESetMapReduce(roots=[1, 2], children=children)
sage: S.setup_workers(2)
sage: S.start_workers(); sleep(float(0.4))
sage: S.start_workers(); sleep(float(5)) # long time
Starting: ...
Starting: ...
sage: [w.is_alive() for w in S._workers]
[True, True]
sage: sleep(float(1.5))
Finished: ...
Finished: ...
sage: [not w.is_alive() for w in S._workers]
[True, True]
Cleanup::
Expand Down

0 comments on commit 47bd349

Please sign in to comment.