From 5c171b72bffd5ea2f2566ba52541dd5faa416c42 Mon Sep 17 00:00:00 2001 From: Quinn Klassen Date: Thu, 6 Jun 2024 07:37:07 -0700 Subject: [PATCH] Make backfill tests more robust (#1504) --- test/integration_test.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/test/integration_test.go b/test/integration_test.go index bbdbdb423..439953910 100644 --- a/test/integration_test.go +++ b/test/integration_test.go @@ -4598,10 +4598,11 @@ func (ts *IntegrationTestSuite) TestScheduleBackfillCreate() { defer func() { ts.NoError(handle.Delete(ctx)) }() - time.Sleep(5 * time.Second) - description, err := handle.Describe(ctx) - ts.NoError(err) - ts.EqualValues(60, description.Info.NumActions) + ts.Eventually(func() bool { + description, err := handle.Describe(ctx) + ts.NoError(err) + return description.Info.NumActions == 60 + }, 15*time.Second, time.Second) } func (ts *IntegrationTestSuite) TestScheduleBackfill() { @@ -4644,10 +4645,11 @@ func (ts *IntegrationTestSuite) TestScheduleBackfill() { }, }) ts.NoError(err) - time.Sleep(5 * time.Second) - description, err = handle.Describe(ctx) - ts.NoError(err) - ts.EqualValues(4, description.Info.NumActions) + ts.Eventually(func() bool { + description, err := handle.Describe(ctx) + ts.NoError(err) + return description.Info.NumActions == 4 + }, 5*time.Second, time.Second) } func (ts *IntegrationTestSuite) TestScheduleList() {