@@ -14,7 +14,7 @@ import (
1414 "testing"
1515 "time"
1616
17- retrygo "github.com/avast/retry-go/v4"
17+ "github.com/avast/retry-go/v4"
1818 "github.com/pact-foundation/pact-go/dsl"
1919 "github.com/pact-foundation/pact-go/types"
2020 "github.com/pact-foundation/pact-go/utils"
@@ -51,11 +51,11 @@ var (
5151 pactServers = make (map [string ]* MockServer )
5252)
5353
54- func defaultRetryOptions () []retrygo .Option {
55- return []retrygo .Option {
56- retrygo .Attempts (defaultRetryAttempts ),
57- retrygo .Delay (defaultRetryDelay ),
58- retrygo .DelayType (retrygo .FixedDelay ),
54+ func defaultRetryOptions () []retry .Option {
55+ return []retry .Option {
56+ retry .Attempts (defaultRetryAttempts ),
57+ retry .Delay (defaultRetryDelay ),
58+ retry .DelayType (retry .FixedDelay ),
5959 }
6060}
6161
@@ -289,7 +289,7 @@ func AddPactInteraction(provider, consumer string, interaction *dsl.Interaction)
289289 return pactServers [key ].AddInteraction (interaction )
290290}
291291
292- func VerifyInteractions (provider , consumer string , retryOptions ... retrygo .Option ) error {
292+ func VerifyInteractions (provider , consumer string , retryOptions ... retry .Option ) error {
293293 verify := func () error {
294294 key := provider + consumer
295295 err := pactServers [key ].Verify ()
@@ -307,7 +307,7 @@ func VerifyInteractions(provider, consumer string, retryOptions ...retrygo.Optio
307307 retryOptions = defaultRetryOptions ()
308308 }
309309 cwd , _ := os .Getwd ()
310- if err := retrygo .Do (verify , retryOptions ... ); err != nil {
310+ if err := retry .Do (verify , retryOptions ... ); err != nil {
311311 return fmt .Errorf ("pact interactions not matched - for details see %s/pact/logs/pact-%s.log" , cwd , provider )
312312 }
313313 return nil
@@ -381,13 +381,13 @@ func EnsurePactRunning(provider, consumer string) string {
381381 Consumer : consumer ,
382382 Provider : provider ,
383383 }
384- err = retrygo .Do (func () error {
384+ err = retry .Do (func () error {
385385 err := mockServer .call ("GET" , serverAddress , nil )
386386 if err != nil && cmd .ProcessState != nil {
387- return fmt .Errorf ("calling mock server: %w" , retrygo .Unrecoverable (err ))
387+ return fmt .Errorf ("calling mock server: %w" , retry .Unrecoverable (err ))
388388 }
389389 return err
390- }, retrygo .DelayType (retrygo .FixedDelay ), retrygo .Delay (mockServerHealthDelay ), retrygo .Attempts (mockServerHealthAttempts ))
390+ }, retry .DelayType (retry .FixedDelay ), retry .Delay (mockServerHealthDelay ), retry .Attempts (mockServerHealthAttempts ))
391391 if err != nil {
392392 log .
393393 WithError (err ).
@@ -408,7 +408,7 @@ func EnsurePactRunning(provider, consumer string) string {
408408
409409// Runs mock services defined by the given pacts,
410410// invokes testFunc then verifies that the pacts have been invoked successfully
411- func RunIntegrationTest (t * testing.T , pactFilePaths []Pact , testFunc func (), retryOptions ... retrygo .Option ) error {
411+ func RunIntegrationTest (t * testing.T , pactFilePaths []Pact , testFunc func (), retryOptions ... retry .Option ) error {
412412 t .Helper ()
413413 return TestWithStubServices (pactFilePaths , func () {
414414 testFunc ()
@@ -420,7 +420,7 @@ func RunIntegrationTest(t *testing.T, pactFilePaths []Pact, testFunc func(), ret
420420 retryOptions = defaultRetryOptions ()
421421 }
422422 verify := func () error { return checkVerificationStatus (pactFilePaths ) }
423- if err := retrygo .Do (verify , retryOptions ... ); err != nil {
423+ if err := retry .Do (verify , retryOptions ... ); err != nil {
424424 log .Error ("Pact verification failed!!" +
425425 "For more info on the error check the logs/pact*.log files, they are quite detailed" )
426426 t .Error (err )
@@ -430,7 +430,7 @@ func RunIntegrationTest(t *testing.T, pactFilePaths []Pact, testFunc func(), ret
430430
431431// Runs mock services defined by the given pacts,
432432// invokes testFunc then verifies that the pacts have been invoked successfully
433- func IntegrationTest (pactFilePaths []Pact , testFunc func (), retryOptions ... retrygo .Option ) error {
433+ func IntegrationTest (pactFilePaths []Pact , testFunc func (), retryOptions ... retry .Option ) error {
434434 return TestWithStubServices (pactFilePaths , func () {
435435 testFunc ()
436436
@@ -441,7 +441,7 @@ func IntegrationTest(pactFilePaths []Pact, testFunc func(), retryOptions ...retr
441441 retryOptions = defaultRetryOptions ()
442442 }
443443 verify := func () error { return checkVerificationStatus (pactFilePaths ) }
444- if err := retrygo .Do (verify , retryOptions ... ); err != nil {
444+ if err := retry .Do (verify , retryOptions ... ); err != nil {
445445 log .Fatalf ("Pact verification failed!!" +
446446 "For more info on the error check the logs/pact*.log files, they are quite detailed" )
447447 }
0 commit comments