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 flaky integration tests #6257

Merged
merged 3 commits into from
Aug 1, 2024
Merged

Fix flaky integration tests #6257

merged 3 commits into from
Aug 1, 2024

Conversation

MetRonnie
Copy link
Member

@MetRonnie MetRonnie commented Jul 23, 2024

Fixes state leakage between integration tests that was resulting in tests/integration/reftests/test_cyclers.py::test_icp_fcp_notation failing flakily.

Salient traceback

cylc/flow/scheduler.py:744: in start
    await self.handle_exception(exc)
cylc/flow/scheduler.py:1996: in handle_exception
    raise exc from None
cylc/flow/scheduler.py:741: in start
    await self.configure(params)
cylc/flow/scheduler.py:495: in configure
    self._load_pool_from_point()
cylc/flow/scheduler.py:782: in _load_pool_from_point
    self.pool.load_from_point()
cylc/flow/task_pool.py:197: in load_from_point
    self.spawn_to_rh_limit(tdef, point, {flow_num})
cylc/flow/task_pool.py:787: in spawn_to_rh_limit
    self.get_or_spawn_task(
cylc/flow/task_pool.py:745: in get_or_spawn_task
    ntask = self.spawn_task(tdef.name, point, flow_nums, flow_wait)
cylc/flow/task_pool.py:1686: in spawn_task
    itask = self._get_task_proxy_db_outputs(
cylc/flow/task_pool.py:1793: in _get_task_proxy_db_outputs
    itask = TaskProxy(
cylc/flow/task_proxy.py:294: in __init__
    self.graph_children = generate_graph_children(tdef, self.point)
cylc/flow/taskdef.py:49: in generate_graph_children
    if is_abs and trigger.get_parent_point(point) != point:
cylc/flow/task_trigger.py:74: in get_parent_point
    point = get_point(self.cycle_point_offset).standardise()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = +P0

    def standardise(self):
        """Reformat self.value into a standard representation."""
        try:
            self.value = str(point_parse(self.value))
        except IsodatetimeError as exc:
            if self.value.startswith("+") or self.value.startswith("-"):
                message = WARNING_PARSE_EXPANDED_YEAR_DIGITS % (
                    WorkflowSpecifics.NUM_EXPANDED_YEAR_DIGITS)
            else:
                message = str(exc)
>           raise PointParsingError(type(self), self.value, message)
E           cylc.flow.exceptions.PointParsingError: Incompatible value for <class 'cylc.flow.cycling.iso8601.ISO8601Point'>: +P0: (incompatible with [cylc]cycle point num expanded year digits = 0 ?)

cylc/flow/cycling/iso8601.py:105: PointParsingError

Also it was failing in a confusing way, so I altered the integration reftest function to better handle unexpected shutdown

@MetRonnie MetRonnie self-assigned this Jul 23, 2024
@MetRonnie MetRonnie added this to the 8.3.4 milestone Jul 23, 2024
@MetRonnie
Copy link
Member Author

MacOS tests failing for unrelated reasons; not tackled in this PR

Comment on lines +627 to +628
if not schd.contact_data:
return True
Copy link
Member Author

Choose a reason for hiding this comment

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

This fixture was waiting for 60 secs for the workflow to shut down even if there was no contact data. If there is no contact data it must have already shut down due to an error or something (which bypasses the set_stop method).

@@ -569,7 +569,7 @@ async def _complete(
Args:
schd:
The scheduler to await.
tokens_list:
wait_tokens:
Copy link
Member

Choose a reason for hiding this comment

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

it might be overloaded, but I think await_tokens would be better English.

Copy link
Member

@wxtim wxtim left a comment

Choose a reason for hiding this comment

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

Nice -One entirely subjective comment about naming which you can take or leave.

@MetRonnie
Copy link
Member Author

MacOS integration test failure is a flaky TUI test

@oliver-sanders
Copy link
Member

(will leave you to accept/reject Tim's suggestion and merge)

@MetRonnie MetRonnie merged commit e2da477 into cylc:8.3.x Aug 1, 2024
11 of 23 checks passed
@MetRonnie MetRonnie deleted the tests branch August 1, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants