From cceaf6e48fd3e4e23612195906e8d1ecd12621f9 Mon Sep 17 00:00:00 2001 From: Amogh-Bharadwaj Date: Thu, 21 Mar 2024 03:07:54 +0530 Subject: [PATCH] change test --- flow/e2e/snowflake/peer_flow_sf_test.go | 33 +++++++++++-------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/flow/e2e/snowflake/peer_flow_sf_test.go b/flow/e2e/snowflake/peer_flow_sf_test.go index b0ae6e2096..b1e7e2de70 100644 --- a/flow/e2e/snowflake/peer_flow_sf_test.go +++ b/flow/e2e/snowflake/peer_flow_sf_test.go @@ -1147,28 +1147,23 @@ func (s PeerFlowE2ETestSuiteSF) Test_Interval_SF() { // and then insert 20 rows into the source table env := e2e.ExecutePeerflow(tc, peerflow.CDCFlowWorkflow, flowConnConfig, nil) e2e.SetupCDCFlowStatusQuery(s.t, env, connectionGen) - // insert 20 rows into the source table - for range 20 { - _, err = s.Conn().Exec(context.Background(), fmt.Sprintf(` + + _, err = s.Conn().Exec(context.Background(), fmt.Sprintf(` INSERT INTO e2e_test_%s."%s"(dur) SELECT - floor(random() * 100)::int || ' days ' || - floor(random() * 24)::int || ' hours ' || - floor(random() * 60)::int || ' minutes ' || - floor(random() * 60)::int || ' seconds ' || - floor(random() * 30)::int || ' months' AS random_interval; + make_interval( + 20, + floor(random() * 24)::int, + floor(random() * 60)::int, + floor(random() * 60)::int, + floor(random() * 30)::int + ); `, s.pgSuffix, "testintervalsf")) - e2e.EnvNoError(s.t, env, err) - } - s.t.Log("Inserted 20 rows into the source table") - e2e.EnvWaitForEqualTablesWithNames( - env, - s, - "normalize interval sf test", - "testintervalsf", - "\"testintervalsf\"", - "id,dur", - ) + e2e.EnvNoError(s.t, env, err) + + s.t.Log("Inserted a row into the source table") + err = s.checkJSONValue(dstTableName, "dur", "days", "20") + e2e.EnvNoError(s.t, env, err) env.Cancel() e2e.RequireEnvCanceled(s.t, env) }