Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two tests that fail on a heavily-loaded machine #38825

Merged
merged 2 commits into from
Oct 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The # long time label causes a test failure in the cleanup section, when running tests in non-long mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Loading