whisper: deflake Test*MessageExpiration

These tests have become a common annoyance on CI. Fix them by allowing
messages with expiration == now into the cache and delaying the check
for expired message handling slightly.
This commit is contained in:
Felix Lange
2016-04-15 13:28:46 +02:00
parent fdc5a7dc1a
commit 3a5bdef962
2 changed files with 5 additions and 9 deletions

View File

@@ -255,7 +255,7 @@ func (self *Whisper) add(envelope *Envelope) error {
defer self.poolMu.Unlock()
// short circuit when a received envelope has already expired
if envelope.Expiry <= uint32(time.Now().Unix()) {
if envelope.Expiry < uint32(time.Now().Unix()) {
return nil
}
@@ -278,7 +278,6 @@ func (self *Whisper) add(envelope *Envelope) error {
go self.postEvent(envelope)
}
glog.V(logger.Detail).Infof("cached whisper envelope %x\n", envelope)
return nil
}