@@ -165,10 +165,10 @@ func TestConsumerStop_DoubleStop(t *testing.T) {
165165// returns immediately when the context is already cancelled.
166166func TestReplicationLoop_ContextCancelled (t * testing.T ) {
167167 c , _ := NewConsumer (ConsumerConfig {
168- ConnString : "postgres://test" ,
169- SlotName : "test_slot" ,
168+ ConnString : "postgres://test" ,
169+ SlotName : "test_slot" ,
170170 MaxReconnectAttempts : 1 ,
171- ReconnectBackoff : 10 * time .Millisecond ,
171+ ReconnectBackoff : 10 * time .Millisecond ,
172172 })
173173
174174 ctx , cancel := context .WithCancel (context .Background ())
@@ -185,10 +185,10 @@ func TestReplicationLoop_ContextCancelled(t *testing.T) {
185185// and we test that after MaxReconnectAttempts it returns an error.
186186func TestReplicationLoop_MaxReconnects (t * testing.T ) {
187187 c , _ := NewConsumer (ConsumerConfig {
188- ConnString : "postgres://invalid:5432/test" ,
189- SlotName : "test_slot" ,
188+ ConnString : "postgres://invalid:5432/test" ,
189+ SlotName : "test_slot" ,
190190 MaxReconnectAttempts : 2 ,
191- ReconnectBackoff : 1 * time .Millisecond ,
191+ ReconnectBackoff : 1 * time .Millisecond ,
192192 })
193193
194194 ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
@@ -211,10 +211,10 @@ func TestReplicationLoop_MaxReconnects(t *testing.T) {
211211// TestReplicationLoop_UnlimitedReconnects tests with MaxReconnectAttempts=0.
212212func TestReplicationLoop_UnlimitedReconnects (t * testing.T ) {
213213 c , _ := NewConsumer (ConsumerConfig {
214- ConnString : "postgres://invalid:5432/test" ,
215- SlotName : "test_slot" ,
214+ ConnString : "postgres://invalid:5432/test" ,
215+ SlotName : "test_slot" ,
216216 MaxReconnectAttempts : 0 , // unlimited
217- ReconnectBackoff : 1 * time .Millisecond ,
217+ ReconnectBackoff : 1 * time .Millisecond ,
218218 })
219219
220220 ctx , cancel := context .WithTimeout (context .Background (), 100 * time .Millisecond )
@@ -235,11 +235,11 @@ func TestReplicationLoop_UnlimitedReconnects(t *testing.T) {
235235// are correctly propagated.
236236func TestRunReplication_ConnectFailure (t * testing.T ) {
237237 c , _ := NewConsumer (ConsumerConfig {
238- ConnString : "postgres://nonexistent:5432/test" ,
239- SlotName : "test_slot" ,
240- StandbyTimeout : 10 * time .Second ,
238+ ConnString : "postgres://nonexistent:5432/test" ,
239+ SlotName : "test_slot" ,
240+ StandbyTimeout : 10 * time .Second ,
241241 MaxReconnectAttempts : 1 ,
242- ReconnectBackoff : 1 * time .Millisecond ,
242+ ReconnectBackoff : 1 * time .Millisecond ,
243243 })
244244
245245 ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
@@ -273,9 +273,9 @@ func TestStart_AlreadyRunning(t *testing.T) {
273273// cancelled before the replication connection is established.
274274func TestStart_ContextCancellation (t * testing.T ) {
275275 c , _ := NewConsumer (ConsumerConfig {
276- ConnString : "postgres://nonexistent:5432/test" ,
276+ ConnString : "postgres://nonexistent:5432/test" ,
277277 MaxReconnectAttempts : 1 ,
278- ReconnectBackoff : 1 * time .Millisecond ,
278+ ReconnectBackoff : 1 * time .Millisecond ,
279279 })
280280
281281 ctx , cancel := context .WithCancel (context .Background ())
@@ -293,13 +293,13 @@ func TestStart_ContextCancellation(t *testing.T) {
293293
294294func TestNewConsumer_CustomConfig (t * testing.T ) {
295295 cfg := ConsumerConfig {
296- ConnString : "postgres://test" ,
297- SlotName : "custom_slot" ,
298- PublicationName : "custom_pub" ,
299- StandbyTimeout : 30 * time .Second ,
300- ReconnectBackoff : 5 * time .Second ,
296+ ConnString : "postgres://test" ,
297+ SlotName : "custom_slot" ,
298+ PublicationName : "custom_pub" ,
299+ StandbyTimeout : 30 * time .Second ,
300+ ReconnectBackoff : 5 * time .Second ,
301301 MaxReconnectAttempts : 5 ,
302- Sinks : []Sink {NewMemorySink ()},
302+ Sinks : []Sink {NewMemorySink ()},
303303 }
304304 c , err := NewConsumer (cfg )
305305 if err != nil {
@@ -385,10 +385,10 @@ func TestStart_DeferClosesSinks(t *testing.T) {
385385 sink := NewMemorySink ()
386386
387387 c , _ := NewConsumer (ConsumerConfig {
388- ConnString : "postgres://nonexistent:5432/test" ,
389- Sinks : []Sink {sink },
388+ ConnString : "postgres://nonexistent:5432/test" ,
389+ Sinks : []Sink {sink },
390390 MaxReconnectAttempts : 1 ,
391- ReconnectBackoff : 1 * time .Millisecond ,
391+ ReconnectBackoff : 1 * time .Millisecond ,
392392 })
393393
394394 ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
0 commit comments