diff --git a/e2e-polybft/bridge_test.go b/e2e-polybft/bridge_test.go index 0fe7c410ab..2866f2bb4d 100644 --- a/e2e-polybft/bridge_test.go +++ b/e2e-polybft/bridge_test.go @@ -278,7 +278,7 @@ func TestE2E_CheckpointSubmission(t *testing.T) { t.Logf("Checkpoint block: %d\n", actualCheckpointBlock) - return actualCheckpointBlock < expectedCheckpointBlock, nil + return actualCheckpointBlock == expectedCheckpointBlock, nil } // wait for a single epoch to be checkpointed @@ -590,7 +590,6 @@ func TestE2E_Bridge_ChangeVotingPower(t *testing.T) { t.Logf("Checkpoint block: %d\n", actualCheckpointBlock) - // waiting until condition is true (namely when block 20 gets checkpointed) - return actualCheckpointBlock < finalBlockNumber, nil + return actualCheckpointBlock == finalBlockNumber, nil })) } diff --git a/e2e-polybft/framework/test-bridge.go b/e2e-polybft/framework/test-bridge.go index 8a27c05ac9..1e586e9bde 100644 --- a/e2e-polybft/framework/test-bridge.go +++ b/e2e-polybft/framework/test-bridge.go @@ -116,7 +116,7 @@ func (t *TestBridge) WaitUntil(pollFrequency, timeout time.Duration, handler fun return err } - if !isConditionMet { + if isConditionMet { return nil } } diff --git a/e2e-polybft/framework/test-cluster.go b/e2e-polybft/framework/test-cluster.go index f8878a74df..132b7a0151 100644 --- a/e2e-polybft/framework/test-cluster.go +++ b/e2e-polybft/framework/test-cluster.go @@ -443,7 +443,7 @@ func (c *TestCluster) WaitUntil(dur time.Duration, handler func() bool) error { case <-time.After(2 * time.Second): } - if !handler() { + if handler() { return nil } } @@ -484,12 +484,13 @@ func (c *TestCluster) WaitForBlock(n uint64, timeout time.Duration) error { func (c *TestCluster) WaitForGeneric(dur time.Duration, fn func(*TestServer) bool) error { return c.WaitUntil(dur, func() bool { for _, srv := range c.Servers { - if srv.isRunning() && !fn(srv) { // if server is stopped - skip it - return true + // query only running servers + if srv.isRunning() && !fn(srv) { + return false } } - return false + return true }) } diff --git a/e2e-polybft/txpool_test.go b/e2e-polybft/txpool_test.go index 779871010e..221a08f54a 100644 --- a/e2e-polybft/txpool_test.go +++ b/e2e-polybft/txpool_test.go @@ -71,11 +71,11 @@ func TestE2E_TxPool_Transfer(t *testing.T) { } t.Logf("Balance %s %s", receiver, balance) if balance.Uint64() != uint64(sendAmount) { - return true + return false } } - return false + return true }) require.NoError(t, err) } @@ -104,7 +104,7 @@ func TestE2E_TxPool_Transfer_Linear(t *testing.T) { return true } - return balance.Cmp(big.NewInt(0)) == 0 + return balance.Cmp(big.NewInt(0)) > 0 }) return err