Skip to content

Commit

Permalink
30->15, raise pg timeout to 2m
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Jan 6, 2024
1 parent 2ea6dbd commit 4056b62
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion flow/e2e/congen.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ func (c *FlowConnectionGenerationConfig) GenerateFlowConnectionConfigs() *protos
CdcStagingPath: c.CdcStagingPath,
SoftDelete: c.SoftDelete,
SyncedAtColName: "_PEERDB_SYNCED_AT",
IdleTimeoutSeconds: 30,
IdleTimeoutSeconds: 15,
}
if ret.SoftDelete {
ret.SoftDeleteColName = "_PEERDB_IS_DELETED"
Expand Down
24 changes: 12 additions & 12 deletions flow/e2e/postgres/peer_flow_pg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_PG() {
}
s.t.Log("Inserted 10 rows into the source table")

e2e.EnvWaitFor(s.t, env, time.Minute, "normalize 10 rows", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize 10 rows", func() bool {
return s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t") == nil
})

Expand All @@ -307,7 +307,7 @@ func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_PG() {
e2e.EnvNoError(s.t, env, err)
_, err = s.pool.Exec(context.Background(), fmt.Sprintf(`DELETE FROM %s WHERE MOD(c2,2)=$1`, srcTableName), 0)
e2e.EnvNoError(s.t, env, err)
e2e.EnvWaitFor(s.t, env, time.Minute, "normalize modifications", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize modifications", func() bool {
return s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t") == nil
})
env.CancelWorkflow()
Expand Down Expand Up @@ -446,7 +446,7 @@ func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_Toast_2_PG() {
}
s.t.Log("Inserted 10 rows into the source table")

e2e.EnvWaitFor(s.t, env, time.Minute, "normalize 10 rows", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize 10 rows", func() bool {
return s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t,t2") == nil
})
_, err = s.pool.Exec(context.Background(),
Expand All @@ -455,7 +455,7 @@ func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_Toast_2_PG() {
_, err = s.pool.Exec(context.Background(), fmt.Sprintf(`DELETE FROM %s WHERE MOD(c2,2)=$1`, srcTableName), 0)
e2e.EnvNoError(s.t, env, err)

e2e.EnvWaitFor(s.t, env, time.Minute, "normalize update", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize update", func() bool {
return s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t,t2") == nil
})

Expand Down Expand Up @@ -577,13 +577,13 @@ func (s PeerFlowE2ETestSuitePG) Test_Soft_Delete_Basic() {
_, err = s.pool.Exec(context.Background(), fmt.Sprintf(`
INSERT INTO %s(c1,c2,t) VALUES (1,2,random_string(9000))`, srcTableName))
e2e.EnvNoError(s.t, env, err)
e2e.EnvWaitFor(s.t, env, time.Minute, "normalize row", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize row", func() bool {
return s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t") == nil
})
_, err = s.pool.Exec(context.Background(), fmt.Sprintf(`
UPDATE %s SET c1=c1+4 WHERE id=1`, srcTableName))
e2e.EnvNoError(s.t, env, err)
e2e.EnvWaitFor(s.t, env, time.Minute, "normalize update", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize update", func() bool {
return s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t") == nil
})
// since we delete stuff, create another table to compare with
Expand All @@ -594,7 +594,7 @@ func (s PeerFlowE2ETestSuitePG) Test_Soft_Delete_Basic() {
DELETE FROM %s WHERE id=1`, srcTableName))
e2e.EnvNoError(s.t, env, err)

e2e.EnvWaitFor(s.t, env, time.Minute, "normalize delete", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize delete", func() bool {
return s.comparePGTables(srcTableName, dstTableName+` WHERE NOT "_PEERDB_IS_DELETED"`, "id,c1,c2,t") == nil
})

Expand Down Expand Up @@ -752,7 +752,7 @@ func (s PeerFlowE2ETestSuitePG) Test_Soft_Delete_UD_Same_Batch() {
_, err = s.pool.Exec(context.Background(), fmt.Sprintf(`
INSERT INTO %s(c1,c2,t) VALUES (1,2,random_string(9000))`, srcTableName))
e2e.EnvNoError(s.t, env, err)
e2e.EnvWaitFor(s.t, env, time.Minute, "normalize row", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize row", func() bool {
return s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t") == nil
})

Expand All @@ -769,7 +769,7 @@ func (s PeerFlowE2ETestSuitePG) Test_Soft_Delete_UD_Same_Batch() {
e2e.EnvNoError(s.t, env, err)
e2e.EnvNoError(s.t, env, insertTx.Commit(context.Background()))

e2e.EnvWaitFor(s.t, env, time.Minute, "normalize transaction", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize transaction", func() bool {
return s.comparePGTables(srcTableName, dstTableName+` WHERE NOT "_PEERDB_IS_DELETED"`, "id,c1,c2,t") == nil
})

Expand Down Expand Up @@ -839,19 +839,19 @@ func (s PeerFlowE2ETestSuitePG) Test_Soft_Delete_Insert_After_Delete() {
_, err = s.pool.Exec(context.Background(), fmt.Sprintf(`
INSERT INTO %s(c1,c2,t) VALUES (1,2,random_string(9000))`, srcTableName))
e2e.EnvNoError(s.t, env, err)
e2e.EnvWaitFor(s.t, env, time.Minute, "normalize row", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize row", func() bool {
return s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t") == nil
})
_, err = s.pool.Exec(context.Background(), fmt.Sprintf(`
DELETE FROM %s WHERE id=1`, srcTableName))
e2e.EnvNoError(s.t, env, err)
e2e.EnvWaitFor(s.t, env, time.Minute, "normalize delete", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize delete", func() bool {
return s.comparePGTables(srcTableName, dstTableName+` WHERE NOT "_PEERDB_IS_DELETED"`, "id,c1,c2,t") == nil
})
_, err = s.pool.Exec(context.Background(), fmt.Sprintf(`
INSERT INTO %s(id,c1,c2,t) VALUES (1,3,4,random_string(10000))`, srcTableName))
e2e.EnvNoError(s.t, env, err)
e2e.EnvWaitFor(s.t, env, time.Minute, "normalize reinsert", func() bool {
e2e.EnvWaitFor(s.t, env, 2*time.Minute, "normalize reinsert", func() bool {
return s.comparePGTables(srcTableName, dstTableName, "id,c1,c2,t") == nil
})

Expand Down

0 comments on commit 4056b62

Please sign in to comment.