Skip to content

Commit 8263e6e

Browse files
committed
avoid flakiness in latest s3 test due to race
1 parent 914beef commit 8263e6e

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

flow/e2e/s3/cdc_s3_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,17 @@ func (s PeerFlowE2ETestSuiteS3) Test_Complete_Simple_Flow_S3() {
6565
return len(files) == 4
6666
})
6767

68-
// s3 normalize is nop, so check peerdb_stats directly that batch finalized
6968
pool, err := internal.GetCatalogConnectionPoolFromEnv(s.t.Context())
7069
require.NoError(s.t, err)
71-
var count int64
72-
require.NoError(s.t, pool.QueryRow(s.t.Context(),
73-
"select count(*) from peerdb_stats.cdc_batches where flow_name = $1 and end_time is not null",
74-
flowJobName,
75-
).Scan(&count))
76-
require.Equal(s.t, int64(4), count)
70+
e2e.EnvWaitFor(s.t, env, time.Minute, "waiting for cdc batch completion", func() bool {
71+
// s3 normalize is nop, so check peerdb_stats directly that batch finalized
72+
var count int64
73+
require.NoError(s.t, pool.QueryRow(s.t.Context(),
74+
"select count(*) from peerdb_stats.cdc_batches where flow_name = $1 and end_time is not null",
75+
flowJobName,
76+
).Scan(&count))
77+
return count == 4
78+
})
7779

7880
env.Cancel(s.t.Context())
7981
e2e.RequireEnvCanceled(s.t, env)

0 commit comments

Comments
 (0)