Skip to content

Commit

Permalink
change test
Browse files Browse the repository at this point in the history
  • Loading branch information
Amogh-Bharadwaj committed Mar 20, 2024
1 parent f9918b6 commit cceaf6e
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions flow/e2e/snowflake/peer_flow_sf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

0 comments on commit cceaf6e

Please sign in to comment.