Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide correct state sync event logs filter in TestE2E_Bridge_Transfers #1381

Merged
merged 4 commits into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions e2e-polybft/e2e/bridge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func TestE2E_Bridge_Transfers(t *testing.T) {
numBlockConfirmations = 2
// make epoch size long enough, so that all exit events are processed within the same epoch
epochSize = 30
sprintSize = 5
sprintSize = uint64(5)
)

receivers := make([]string, transfersCount)
Expand Down Expand Up @@ -78,8 +78,9 @@ func TestE2E_Bridge_Transfers(t *testing.T) {
),
)

finalBlockNum := 8 * sprintSize
// wait for a couple of sprints
require.NoError(t, cluster.WaitForBlock(8*sprintSize, 2*time.Minute))
require.NoError(t, cluster.WaitForBlock(finalBlockNum, 2*time.Minute))

// the transactions are processed and there should be a success events
var stateSyncedResult contractsapi.StateSyncResultEvent
Expand All @@ -92,7 +93,7 @@ func TestE2E_Bridge_Transfers(t *testing.T) {
}

filter.SetFromUint64(0)
filter.SetToUint64(100)
filter.SetToUint64(finalBlockNum)

logs, err := childEthEndpoint.GetLogs(filter)
require.NoError(t, err)
Expand Down Expand Up @@ -229,6 +230,7 @@ func TestE2E_Bridge_Transfers(t *testing.T) {
),
)

finalBlockNum := midBlockNumber + 5*sprintSize
// wait for a few more sprints
require.NoError(t, cluster.WaitForBlock(midBlockNumber+5*sprintSize, 3*time.Minute))

Expand All @@ -253,7 +255,7 @@ func TestE2E_Bridge_Transfers(t *testing.T) {
}

filter.SetFromUint64(initialBlockNum)
filter.SetToUint64(initialBlockNum + 2*epochSize)
filter.SetToUint64(finalBlockNum)

logs, err := childEthEndpoint.GetLogs(filter)
require.NoError(t, err)
Expand Down
2 changes: 1 addition & 1 deletion syncer/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ func TestPeerConnectionUpdateEventCh(t *testing.T) {
wgForGossip.Wait()

// close to terminate goroutine
close(client.peerStatusUpdateCh)
client.Close()

// wait until collecting routine is done
wgForConnectingStatus.Wait()
Expand Down