Skip to content

Commit

Permalink
test_plugin_piggyback: Restore test
Browse files Browse the repository at this point in the history
Increase robustness of the test via:
* Increasing waiting counter for DCD changes
* Reduce assertion strictness over pending changes during teardown

Change-Id: Ifa7620014b37fe8466f57cb20df9807044292b94
  • Loading branch information
MatteoStifano committed Jan 10, 2025
1 parent 46a9474 commit 5a0cfe1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
10 changes: 5 additions & 5 deletions tests/plugins_integration/checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -519,9 +519,9 @@ def setup_source_host_piggyback(site: Site, source_host_name: str) -> Iterator:
== 0
)

logger.info("Activating changes & reloading core...")
site.activate_changes_and_wait_for_core_reload(allow_foreign_changes=True)

site.openapi.changes.activate_and_wait_for_completion(
force_foreign_changes=True, strict=False
)
_wait_for_piggyback_hosts_deletion(site, source_host=source_host_name)
wait_for_dcd_pend_changes(site)

Expand Down Expand Up @@ -632,8 +632,8 @@ def _wait_for_piggyback_hosts_deletion(site: Site, source_host: str, strict: boo


def wait_for_dcd_pend_changes(site: Site) -> None:
"""Wait up to 60 seconds for DCD to activate changes."""
max_count = 60
"""Wait up to 120 seconds for DCD to activate changes."""
max_count = 120
count = 0
while (n_pending_changes := len(site.openapi.changes.get_pending())) > 0 and count < max_count:
logger.info(
Expand Down
1 change: 0 additions & 1 deletion tests/plugins_integration/test_plugin_piggyback.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ def _wait_for_pb_host_deletion(site: Site, source_host_name: str, pb_host_name:
), f"Host {pb_host_name} was not removed from the site."


@pytest.mark.xfail(reason="Test currently flaky")
@pytest.mark.parametrize("source_host_name", get_host_names(piggyback=True))
def test_plugin_piggyback(
test_site_piggyback: Site,
Expand Down

0 comments on commit 5a0cfe1

Please sign in to comment.