-
Notifications
You must be signed in to change notification settings - Fork 94
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
task_pool: fix compute_runahead calculation #5833
Conversation
@@ -362,20 +362,35 @@ def compute_runahead(self, force=False) -> bool: | |||
# Find the earliest point with unfinished tasks. | |||
for point, itasks in sorted(self.get_tasks_by_point().items()): | |||
if ( | |||
points # got the limit already so this point too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could never be true as points is populated on a different branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's populated on this branch too, within the same loop. So the logic says to automatically append the next points once we have added the first one based on the state checks. (However, I'm not sure why it wasn't just stopping at the first one, since then we just take the min anyway).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we're iterating in sorted order the earlier cycles should come first, so a break
should make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's using points later in ways which don't cause test failures, so I'll restore the original to avoid breakages.
Actually, no, adding this line back breaks the new tests. I'm not sure why we would add cycle points with no active tasks to the points list?
not itask.state( | ||
TASK_STATUS_FAILED, | ||
TASK_STATUS_SUCCEEDED, | ||
TASK_STATUS_EXPIRED | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This counted waiting runahead tasks.
It should be superfluous if not cylc.flow.flags.cylc7_back_compat
because is_incomplete
should cover it anyway.
40db21c
to
299ec97
Compare
series using the same pytest runner. This incentivises breaking up larger test | ||
modules. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible alternative
series using the same pytest runner. This incentivises breaking up larger test | |
modules. | |
series using the same pytest runner. Consider breaking up | |
large test modules to allow tests to be run in parallel. |
Got integration test failures |
See the OP, caused by the same issue fixed in #5826 |
Is that the correct PR? It doesn't mention closing an issue, and also is against master rather than 8.2.x |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the new logic is correct, but can we just bail out of the loop once the first point is found? (given the loop is over sorted points, and we only want the min point in the end).
@@ -362,20 +362,35 @@ def compute_runahead(self, force=False) -> bool: | |||
# Find the earliest point with unfinished tasks. | |||
for point, itasks in sorted(self.get_tasks_by_point().items()): | |||
if ( | |||
points # got the limit already so this point too |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's populated on this branch too, within the same loop. So the logic says to automatically append the next points once we have added the first one based on the state checks. (However, I'm not sure why it wasn't just stopping at the first one, since then we just take the min anyway).
Yes, it's the right PR, the issue bring fixed was the way the time zone variable was set in the tests. Will have to pull the fix into 8.2.x. |
* Closes cylc#5825 * Cycles were considered active if they contained runahead limited tasks. * This could cause the runahead limit to be bumped forwards whenever the limit calculation was forced to update, e.g. on reload. * This filters out tasks at or beyond the runahead limit and straigntens out the task status checks to match Cylc 7 behaviour in compat mode.
* Setting the TZ env var within a Python session doesn't work as intended. * We'll add a TZ offset in CI in the near future.
b332dda
to
94a749c
Compare
# a weird timezone to check that tests aren't assuming the local timezone | ||
TZ=XXX-09:35 | ||
# Note: this doesn't work properly with pytest-xdist | ||
# TZ=XXX-09:35 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This prevents the new test from failing.
Setting the TZ variable in this way doesn't work as intended.
A solution will arrive in #5826
tests/f/runahead all pass, but a bunch of others fail, back to draft. |
Hopefully superseded by #5893 |
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.