diff options
author | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-11-24 20:48:47 +0800 |
---|---|---|
committer | Jeffrey Wilcke <geffobscura@gmail.com> | 2015-11-24 20:48:47 +0800 |
commit | 5490437942967638bcc6198035315f6811febaa8 (patch) | |
tree | ec4fbee454bacbf2b80b5a7ff402fb48dd2c10cf /whisper | |
parent | e5532154a50114d5ffb1ffd850b746cab00cb899 (diff) | |
parent | b0fb48c389460193d9fc0a5118d79ff6dec48ce0 (diff) | |
download | go-tangerine-5490437942967638bcc6198035315f6811febaa8.tar go-tangerine-5490437942967638bcc6198035315f6811febaa8.tar.gz go-tangerine-5490437942967638bcc6198035315f6811febaa8.tar.bz2 go-tangerine-5490437942967638bcc6198035315f6811febaa8.tar.lz go-tangerine-5490437942967638bcc6198035315f6811febaa8.tar.xz go-tangerine-5490437942967638bcc6198035315f6811febaa8.tar.zst go-tangerine-5490437942967638bcc6198035315f6811febaa8.zip |
Merge branch 'develop' into release/1.3.2v1.3.2
Conflicts:
VERSION
cmd/geth/main.go
Diffstat (limited to 'whisper')
-rw-r--r-- | whisper/whisper_test.go | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/whisper/whisper_test.go b/whisper/whisper_test.go index b5a919984..1a9a8667a 100644 --- a/whisper/whisper_test.go +++ b/whisper/whisper_test.go @@ -189,13 +189,22 @@ func TestMessageExpiration(t *testing.T) { t.Fatalf("failed to inject message: %v", err) } // Check that the message is inside the cache - if _, ok := node.messages[envelope.Hash()]; !ok { + node.poolMu.RLock() + _, found := node.messages[envelope.Hash()] + node.poolMu.RUnlock() + + if !found { t.Fatalf("message not found in cache") } // Wait for expiration and check cache again time.Sleep(time.Second) // wait for expiration time.Sleep(expirationCycle) // wait for cleanup cycle - if _, ok := node.messages[envelope.Hash()]; ok { + + node.poolMu.RLock() + _, found = node.messages[envelope.Hash()] + node.poolMu.RUnlock() + + if found { t.Fatalf("message not expired from cache") } } |