From 1543c5f0adbb8ee8954e5f8e2bb36e6b402abbe2 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Thu, 5 Sep 2024 17:47:53 +0200 Subject: [PATCH] test/e2e: fix network prune flake Creating networks in a different dir is not parallel safe when running containers on them as the network configs may end up using the same bridge names which then causes conflicts on the host. Fixes #23876 Signed-off-by: Paul Holzinger --- test/e2e/common_test.go | 3 +++ test/e2e/network_test.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/test/e2e/common_test.go b/test/e2e/common_test.go index 2c36c43e08..d19306c533 100644 --- a/test/e2e/common_test.go +++ b/test/e2e/common_test.go @@ -1410,6 +1410,9 @@ func WaitForService(address url.URL) { // This needs to be called for all test they may remove networks from other tests, // so netwokr prune, system prune, or system reset. // see https://github.com/containers/podman/issues/17946 +// Note that when using this and running containers with custom networks you must use the +// ginkgo Serial decorator to ensure no parallel test are running otherwise we get flakes, +// https://github.com/containers/podman/issues/23876 func useCustomNetworkDir(podmanTest *PodmanTestIntegration, tempdir string) { // set custom network directory to prevent flakes since the dir is shared with all tests by default podmanTest.NetworkConfigDir = tempdir diff --git a/test/e2e/network_test.go b/test/e2e/network_test.go index 450ceba71e..08813a85ce 100644 --- a/test/e2e/network_test.go +++ b/test/e2e/network_test.go @@ -695,7 +695,7 @@ var _ = Describe("Podman network", func() { Expect(listAgain.OutputToStringArray()).Should(ContainElement("podman")) }) - It("podman network prune", func() { + It("podman network prune", Serial, func() { useCustomNetworkDir(podmanTest, tempdir) // Create two networks // Check they are there