diff --git a/src/acceptance/app/dynamic_policy_test.go b/src/acceptance/app/dynamic_policy_test.go index 1a471e1e87..18f8f45be7 100644 --- a/src/acceptance/app/dynamic_policy_test.go +++ b/src/acceptance/app/dynamic_policy_test.go @@ -183,7 +183,7 @@ var _ = Describe("AutoScaler dynamic policy", func() { }) JustBeforeEach(func() { - // simulates ~100 requests per second + // simulate ongoing ~100 requests per second ticker = time.NewTicker(10 * time.Millisecond) go func(chan bool) { defer GinkgoRecover() @@ -206,6 +206,12 @@ var _ = Describe("AutoScaler dynamic policy", func() { WaitForNInstancesRunning(appGUID, 2, 5*time.Minute) }) + AfterEach(func() { + // ginkgo requires all go-routines to be finished before reporting the result. + // give the curl-command executing go-routines some time to return. + time.Sleep(10 * time.Second) + }) + }) Context("when throughput is less than scaling in threshold", func() {