From 5acf8ae120518cd69437bee778c5fa4ba03eff9b Mon Sep 17 00:00:00 2001 From: Ed Santiago Date: Wed, 22 Sep 2021 07:30:03 -0600 Subject: Eighty-six eighty-eighty (Sorry, couldn't resist). CI flakes have been coming down - thank you to everyone who has been making them a priority. This leaves a noisy subset that I've just been ignoring for months: Running: podman ... -p 8080:something ...cannot listen on the TCP port: listen tcp4 :8080: bind: address already in use Sometimes these are one-time errors resolved on 2nd try; sometimes they fail three times, forcing CI user to hit Rerun. In all cases they make noise in my flake logs, which costs me time. My assumption is that this has to do with ginkgo running random tests in parallel. Since many e2e tests simplemindedly use 8080, collisions are inevitable. Solution: simplemindedly replace 8080 with other (also arbitrarily picked) numbers. This is imperfect -- it requires human developers to pick a number NNNN and 'grep NNNN test/e2e/*' before adding new tests, which I am 100% confident ain't gonna happen -- but it's better than what we have now. Side note: I considered writing and using a RandomAvailablePort() helper, but that would still be racy. Plus, it would be a pain to interpolate strings into so many places. Finally, with this hand-tooled approach, if/when we _do_ get conflicts on port NNNN, it should be very easy to grep for NNNN, find the offending tests that reuse that port, and fix one of them. Signed-off-by: Ed Santiago --- test/e2e/run_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/e2e/run_test.go') diff --git a/test/e2e/run_test.go b/test/e2e/run_test.go index ec4b0d997..b6743f4b7 100644 --- a/test/e2e/run_test.go +++ b/test/e2e/run_test.go @@ -1148,11 +1148,11 @@ USER mail`, BB) }) It("podman run --pod automatically", func() { - session := podmanTest.Podman([]string{"run", "-d", "--pod", "new:foobar", ALPINE, "nc", "-l", "-p", "8080"}) + session := podmanTest.Podman([]string{"run", "-d", "--pod", "new:foobar", ALPINE, "nc", "-l", "-p", "8686"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) - session = podmanTest.Podman([]string{"run", "--pod", "foobar", ALPINE, "/bin/sh", "-c", "echo test | nc -w 1 127.0.0.1 8080"}) + session = podmanTest.Podman([]string{"run", "--pod", "foobar", ALPINE, "/bin/sh", "-c", "echo test | nc -w 1 127.0.0.1 8686"}) session.WaitWithDefaultTimeout() Expect(session).Should(Exit(0)) -- cgit v1.2.3-54-g00ecf