Skip to content

Commit

Permalink
idea: need to sleep to avoid test ending before slot closed
Browse files Browse the repository at this point in the history
  • Loading branch information
serprex committed Jan 4, 2024
1 parent 73dcd18 commit 51760c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 1 addition & 3 deletions flow/connectors/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ func (c *PostgresConnector) SetLastOffset(jobName string, lastOffset int64) erro

// PullRecords pulls records from the source.
func (c *PostgresConnector) PullRecords(catalogPool *pgxpool.Pool, req *model.PullRecordsRequest) error {
defer func() {
req.RecordStream.Close()
}()
defer req.RecordStream.Close()

// Slotname would be the job name prefixed with "peerflow_slot_"
slotName := fmt.Sprintf("peerflow_slot_%s", req.FlowJobName)
Expand Down
2 changes: 2 additions & 0 deletions flow/e2e/postgres/peer_flow_pg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ func (s PeerFlowE2ETestSuitePG) Test_Simple_Schema_Changes_PG() {
}()

env.ExecuteWorkflow(peerflow.CDCFlowWorkflowWithConfig, flowConnConfig, &limits, nil)
time.Sleep(10 * time.Second)
wg.Wait()
env.AssertExpectations(s.t)
}
Expand Down Expand Up @@ -337,6 +338,7 @@ func (s PeerFlowE2ETestSuitePG) Test_Composite_PKey_PG() {
}()

env.ExecuteWorkflow(peerflow.CDCFlowWorkflowWithConfig, flowConnConfig, &limits, nil)
time.Sleep(10 * time.Second)
wg.Wait()
env.AssertExpectations(s.t)
}
Expand Down

0 comments on commit 51760c9

Please sign in to comment.