From 5a0cfe10c88fa78f6d4b932cc560c42e384a68fe Mon Sep 17 00:00:00 2001 From: Matteo Stifano Date: Tue, 7 Jan 2025 14:59:57 +0100 Subject: [PATCH] test_plugin_piggyback: Restore test Increase robustness of the test via: * Increasing waiting counter for DCD changes * Reduce assertion strictness over pending changes during teardown Change-Id: Ifa7620014b37fe8466f57cb20df9807044292b94 --- tests/plugins_integration/checks.py | 10 +++++----- tests/plugins_integration/test_plugin_piggyback.py | 1 - 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/plugins_integration/checks.py b/tests/plugins_integration/checks.py index a7871a8eaa4..47f4a227f31 100644 --- a/tests/plugins_integration/checks.py +++ b/tests/plugins_integration/checks.py @@ -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) @@ -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( diff --git a/tests/plugins_integration/test_plugin_piggyback.py b/tests/plugins_integration/test_plugin_piggyback.py index 0ffb5bd8b47..00f2e5ff0e9 100644 --- a/tests/plugins_integration/test_plugin_piggyback.py +++ b/tests/plugins_integration/test_plugin_piggyback.py @@ -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,