@@ -163,14 +163,12 @@ func TestSealStopChannel(t *testing.T) {
163
163
stop := make (chan struct {}, 1 )
164
164
eventSub := engine .EventMux ().Subscribe (istanbul.RequestEvent {})
165
165
eventLoop := func () {
166
- select {
167
- case ev := <- eventSub .Chan ():
168
- _ , ok := ev .Data .(istanbul.RequestEvent )
169
- if ! ok {
170
- t .Errorf ("unexpected event comes: %v" , reflect .TypeOf (ev .Data ))
171
- }
172
- stop <- struct {}{}
166
+ ev := <- eventSub .Chan ()
167
+ _ , ok := ev .Data .(istanbul.RequestEvent )
168
+ if ! ok {
169
+ t .Errorf ("unexpected event comes: %v" , reflect .TypeOf (ev .Data ))
173
170
}
171
+ stop <- struct {}{}
174
172
eventSub .Unsubscribe ()
175
173
}
176
174
go eventLoop ()
@@ -189,14 +187,12 @@ func TestSealCommittedOtherHash(t *testing.T) {
189
187
otherBlock := makeBlockWithoutSeal (chain , engine , block )
190
188
eventSub := engine .EventMux ().Subscribe (istanbul.RequestEvent {})
191
189
eventLoop := func () {
192
- select {
193
- case ev := <- eventSub .Chan ():
194
- _ , ok := ev .Data .(istanbul.RequestEvent )
195
- if ! ok {
196
- t .Errorf ("unexpected event comes: %v" , reflect .TypeOf (ev .Data ))
197
- }
198
- engine .Commit (otherBlock , [][]byte {})
190
+ ev := <- eventSub .Chan ()
191
+ _ , ok := ev .Data .(istanbul.RequestEvent )
192
+ if ! ok {
193
+ t .Errorf ("unexpected event comes: %v" , reflect .TypeOf (ev .Data ))
199
194
}
195
+ engine .Commit (otherBlock , [][]byte {})
200
196
eventSub .Unsubscribe ()
201
197
}
202
198
go eventLoop ()
@@ -208,10 +204,8 @@ func TestSealCommittedOtherHash(t *testing.T) {
208
204
209
205
const timeoutDura = 2 * time .Second
210
206
timeout := time .NewTimer (timeoutDura )
211
- select {
212
- case <- timeout .C :
213
- // wait 2 seconds to ensure we cannot get any blocks from Istanbul
214
- }
207
+ <- timeout .C
208
+ // wait 2 seconds to ensure we cannot get any blocks from Istanbul
215
209
}
216
210
217
211
func TestSealCommitted (t * testing.T ) {
0 commit comments