Fix hotloop around scheduling in lifecycle_test

Lifecycle test had a hotloop, where it would run a never-yielding
function while processing was going on elsewhere. This inserts
a sleep. A sleep is used rather than a yield to be kind to
people's battery life.
This commit is contained in:
Sargun Dhillon
2019-08-13 08:53:52 -07:00
parent fbed4ca702
commit edc0991c0c

View File

@@ -333,6 +333,7 @@ func testTerminalStatePodScenario(ctx context.Context, t *testing.T, s *system,
s.start(ctx)
for s.pc.k8sQ.Len() > 0 {
time.Sleep(10 * time.Millisecond)
}
p2, err := s.client.CoreV1().Pods(testNamespace).Get(p1.Name, metav1.GetOptions{})