Commit 5d31aedc authored by John Chilton's avatar John Chilton
Browse files

Likely fix for transiently failing published histories test.

The failing error:

```
self = <galaxy_test.selenium.test_histories_published.TestPublishedHistories object at 0x7f4ae3449e80>

    @selenium_test
    def test_published_histories_username_filter(self):
        self._login()
        self.navigate_to_published_histories()
        username = self.user2_email.split("@")[0]
        self.components.published_histories.search_input.wait_for_and_send_keys(f"user:{username}")
>       self.assert_histories_present([self.history2_name])
```
parent 0b743f88
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ from galaxy.selenium.axe_results import assert_baseline_accessible
from galaxy.selenium.context import GalaxySeleniumContext
from galaxy.selenium.has_driver import DEFAULT_AXE_SCRIPT_URL
from galaxy.selenium.navigates_galaxy import (
    exception_seems_to_indicate_transition,
    NavigatesGalaxy,
    retry_during_transitions,
)
@@ -223,8 +224,17 @@ def selenium_test(f):
    return func_wrapper


def exception_is_assertion_or_transition(e: Exception) -> bool:
    """Drive the retry_assertion_during_transitions decorator.

    Reuse logic for checking for transition exceptions but also retry
    if there is an assertion error.
    """
    return exception_seems_to_indicate_transition(e) or isinstance(e, AssertionError)


retry_assertion_during_transitions = partial(
    retry_during_transitions, exception_check=lambda e: isinstance(e, AssertionError)
    retry_during_transitions, exception_check=exception_is_assertion_or_transition
)