From 37e57a903cf0d40e53a97eb3d47036024d7536c3 Mon Sep 17 00:00:00 2001 From: Nicolas Lacasse Date: Wed, 3 Oct 2018 10:46:42 -0700 Subject: [PATCH] Fix arithmetic error in multi_container_test. We add an additional (2^3)-1=7 processes, but the code was only waiting for 3. I switched back to Math.Pow format to make the arithmetic easier to inspect. PiperOrigin-RevId: 215588140 Change-Id: Iccad4d6f977c1bfc5c4b08d3493afe553fe25733 --- runsc/container/multi_container_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/runsc/container/multi_container_test.go b/runsc/container/multi_container_test.go index ab200b75c..d23d36c37 100644 --- a/runsc/container/multi_container_test.go +++ b/runsc/container/multi_container_test.go @@ -568,7 +568,8 @@ func TestMultiContainerKillAll(t *testing.T) { if _, err := containers[1].Execute(args); err != nil { t.Fatalf("error exec'ing: %v", err) } - procCount += 3 + // Wait for these new processes to start. + procCount += int(math.Pow(2, 3) - 1) if err := waitForProcessCount(containers[1], procCount); err != nil { t.Fatal(err) }