Commit 7e3e9af7 authored by Aaron Chen's avatar Aaron Chen Committed by GitHub

op-challenger: fix a bug in TestMonitorGames (#10307)

* op-challenger: fix a bug in TestMonitorGames

* just return instead of break loop

* remove blank lines
parent 8c19065a
...@@ -49,7 +49,7 @@ func TestMonitorGames(t *testing.T) { ...@@ -49,7 +49,7 @@ func TestMonitorGames(t *testing.T) {
}: }:
headerNotSent = false headerNotSent = false
case <-ctx.Done(): case <-ctx.Done():
break return
default: default:
} }
} }
...@@ -97,13 +97,12 @@ func TestMonitorGames(t *testing.T) { ...@@ -97,13 +97,12 @@ func TestMonitorGames(t *testing.T) {
Number: big.NewInt(1), Number: big.NewInt(1),
}: }:
case <-ctx.Done(): case <-ctx.Done():
break return
default: default:
} }
// Just to avoid a tight loop // Just to avoid a tight loop
time.Sleep(100 * time.Millisecond) time.Sleep(100 * time.Millisecond)
} }
require.NoError(t, waitErr)
mockHeadSource.SetErr(fmt.Errorf("eth subscribe test error")) mockHeadSource.SetErr(fmt.Errorf("eth subscribe test error"))
cancel() cancel()
}() }()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment