(t *testing.T, walFilePath string, replicaConn *pgx.Conn, primaryDns string)
| 569 | } |
| 570 | |
| 571 | func newReplicator(t *testing.T, walFilePath string, replicaConn *pgx.Conn, primaryDns string) *logrepl.LogicalReplicator { |
| 572 | connString := replicaConn.PgConn().Conn().RemoteAddr().String() |
| 573 | _, port, err := net.SplitHostPort(connString) |
| 574 | require.NoError(t, err) |
| 575 | |
| 576 | replicaDns := fmt.Sprintf("postgres://postgres:password@127.0.0.1:%s/", port) |
| 577 | |
| 578 | r, err := logrepl.NewLogicalReplicator(walFilePath, primaryDns, replicaDns) |
| 579 | require.NoError(t, err) |
| 580 | return r |
| 581 | } |
| 582 | |
| 583 | // runReplicationScript runs the script given on the postgres connection provided. This does not handle assertions that |
| 584 | // use ExpectedRaw. |
no test coverage detected