@@ -151,8 +151,8 @@ func TestCertRevocation(t *testing.T) {
151
151
152
152
sentHello := false
153
153
l := sync.Mutex {}
154
- senderMock : = mock.Mock {}
155
- senderMock .On ("Send" , mock .Anything , mock .Anything ).Run (func (arg mock.Arguments ) {
154
+ sender . Mock = mock.Mock {}
155
+ sender .On ("Send" , mock .Anything , mock .Anything ).Run (func (arg mock.Arguments ) {
156
156
msg := arg .Get (0 ).(* proto.SignedGossipMessage )
157
157
l .Lock ()
158
158
defer l .Unlock ()
@@ -176,11 +176,10 @@ func TestCertRevocation(t *testing.T) {
176
176
askedForIdentity <- struct {}{}
177
177
}
178
178
})
179
- sender .Mock = senderMock
180
179
testCertificateUpdate (t , true , cStore )
181
180
// Shouldn't have asked, because already got identity
182
181
select {
183
- case <- time .After (time .Second * 3 ):
182
+ case <- time .After (time .Second * 5 ):
184
183
case <- askedForIdentity :
185
184
assert .Fail (t , "Shouldn't have asked for an identity, becase we already have it" )
186
185
}
@@ -190,33 +189,10 @@ func TestCertRevocation(t *testing.T) {
190
189
cStore .listRevokedPeers (func (id api.PeerIdentityType ) bool {
191
190
return string (id ) == "B"
192
191
})
193
- sentHello = false
194
- l = sync.Mutex {}
195
- senderMock = mock.Mock {}
196
- senderMock .On ("Send" , mock .Anything , mock .Anything ).Run (func (arg mock.Arguments ) {
197
- msg := arg .Get (0 ).(* proto.SignedGossipMessage )
198
- l .Lock ()
199
- defer l .Unlock ()
200
-
201
- if hello := msg .GetHello (); hello != nil && ! sentHello {
202
- sentHello = true
203
- dig := & proto.GossipMessage {
204
- Tag : proto .GossipMessage_EMPTY ,
205
- Content : & proto.GossipMessage_DataDig {
206
- DataDig : & proto.DataDigest {
207
- Nonce : hello .Nonce ,
208
- MsgType : proto .PullMsgType_IDENTITY_MSG ,
209
- Digests : []string {"B" },
210
- },
211
- },
212
- }
213
- go cStore .handleMessage (& sentMsg {msg : dig .NoopSign ()})
214
- }
215
192
216
- if dataReq := msg .GetDataReq (); dataReq != nil {
217
- askedForIdentity <- struct {}{}
218
- }
219
- })
193
+ l .Lock ()
194
+ sentHello = false
195
+ l .Unlock ()
220
196
221
197
select {
222
198
case <- time .After (time .Second * 5 ):
@@ -435,7 +411,7 @@ func createObjects(updateFactory func(uint64) proto.ReceivedMessage, msgCons pro
435
411
config := pull.Config {
436
412
MsgType : proto .PullMsgType_IDENTITY_MSG ,
437
413
PeerCountToSelect : 1 ,
438
- PullInterval : time .Millisecond * 500 ,
414
+ PullInterval : time .Second ,
439
415
Tag : proto .GossipMessage_EMPTY ,
440
416
Channel : nil ,
441
417
ID : "id1" ,
0 commit comments