Skip to content

Commit

Permalink
remove attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
vgonkivs committed Sep 29, 2023
1 parent 8a60421 commit 4f3659a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions nodebuilder/tests/fraud_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,25 +119,22 @@ func TestFraudProofHandling(t *testing.T) {
// FIXME: Eventually, this should be a check on service registry managing and keeping
// lifecycles of each Module.
// 6.
attempts := 0
// random height after befp.height
height := uint64(15)
// initial timeout is set to 5 sec, as we are targeting the height=15,
// blockTime=1 sec, expected befp height=10
// blockTime=1 sec, expected befp.height=10
timeOut := blockTime * 5

// during befp validation the node can still receive headers and it mostly depends on
// the operating system or hardware(e.g. on macOS tests is working 100% time with a single height=15,
// and on the Linux VM sometimes the last height is 17-18). So, lets give a chance for our befp validator to check
// the fraud proof and stop the syncer.
for attempts < 5 {
for height < 20 {
syncCtx, syncCancel := context.WithTimeout(context.Background(), timeOut)
_, err = full.HeaderServ.WaitForHeight(syncCtx, height)
syncCancel()
if err != nil {
break
}
attempts++
timeOut = blockTime
height++
}
Expand Down Expand Up @@ -167,7 +164,6 @@ func TestFraudProofHandling(t *testing.T) {
// 9.
fN := sw.NewNodeWithStore(node.Full, store)
err = fN.Start(ctx)
require.Error(t, err)
var fpExist *fraud.ErrFraudExists[*header.ExtendedHeader]
require.ErrorAs(t, err, &fpExist)

Expand Down

0 comments on commit 4f3659a

Please sign in to comment.