diff --git a/bridge/standard/pkg/store/store_test.go b/bridge/standard/pkg/store/store_test.go index 7a1c96b4b..961583418 100644 --- a/bridge/standard/pkg/store/store_test.go +++ b/bridge/standard/pkg/store/store_test.go @@ -6,6 +6,7 @@ import ( "fmt" "math/big" "testing" + "time" "github.com/ethereum/go-ethereum/common" "github.com/primev/mev-commit/bridge/standard/pkg/store" @@ -33,7 +34,12 @@ func TestStore(t *testing.T) { "POSTGRES_USER": "user", "POSTGRES_PASSWORD": "password", }, - WaitingFor: wait.ForListeningPort("5432/tcp"), + WaitingFor: wait.ForAll( + wait.ForLog("database system is ready to accept connections"). + WithOccurrence(2). + WithStartupTimeout(60*time.Second), + wait.ForListeningPort("5432/tcp"), + ), } // Start the PostgreSQL container diff --git a/oracle/pkg/store/store_test.go b/oracle/pkg/store/store_test.go index 6ae63a4f1..3297b1852 100644 --- a/oracle/pkg/store/store_test.go +++ b/oracle/pkg/store/store_test.go @@ -6,6 +6,7 @@ import ( "fmt" "math/big" "testing" + "time" "github.com/ethereum/go-ethereum/common" "github.com/google/go-cmp/cmp" @@ -46,7 +47,12 @@ func TestStore(t *testing.T) { "POSTGRES_USER": "user", "POSTGRES_PASSWORD": "password", }, - WaitingFor: wait.ForListeningPort("5432/tcp"), + WaitingFor: wait.ForAll( + wait.ForLog("database system is ready to accept connections"). + WithOccurrence(2). + WithStartupTimeout(60*time.Second), + wait.ForListeningPort("5432/tcp"), + ), } // Start the PostgreSQL container diff --git a/tools/preconf-rpc/store/store_test.go b/tools/preconf-rpc/store/store_test.go index 8773410e3..8f4464527 100644 --- a/tools/preconf-rpc/store/store_test.go +++ b/tools/preconf-rpc/store/store_test.go @@ -33,7 +33,12 @@ func TestStore(t *testing.T) { "POSTGRES_USER": "user", "POSTGRES_PASSWORD": "password", }, - WaitingFor: wait.ForListeningPort("5432/tcp"), + WaitingFor: wait.ForAll( + wait.ForLog("database system is ready to accept connections"). + WithOccurrence(2). + WithStartupTimeout(60*time.Second), + wait.ForListeningPort("5432/tcp"), + ), } // Start the PostgreSQL container