From 357786eeca83e49948d9ab2d07a7a92b48ffa238 Mon Sep 17 00:00:00 2001 From: Dmitry Shulyak Date: Fri, 4 May 2018 08:57:34 +0300 Subject: [PATCH] Fix bloom filter expectations in group chat test Every peer must be subscribed to the topic that is used to send messages. In the test Alice was communicating with Bob and Charlie over custom topic, but that topic wasn't added to a bloom filter, thus a certain flake was possible. Normally it wasn't causing problems because syncAllowance in whisper, which is 10s: - we set bloom filter to all zeros - but we still will accept all envelopes for 10s - in case we send first envelope into such channel after sync allowance - we will get an error such that envelope doesn't match the bloom filter --- t/e2e/whisper/whisper_mailbox_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/e2e/whisper/whisper_mailbox_test.go b/t/e2e/whisper/whisper_mailbox_test.go index 5030c8668..525903246 100644 --- a/t/e2e/whisper/whisper_mailbox_test.go +++ b/t/e2e/whisper/whisper_mailbox_test.go @@ -201,6 +201,12 @@ func (s *WhisperMailboxSuite) TestRequestMessagesInGroupChat() { charliePubkey := hexutil.Bytes(crypto.FromECDSAPub(&charlieKey.PublicKey)) charlieAliceKeySendTopic := whisper.BytesToTopic([]byte("charlieAliceKeySendTopic ")) + // Alice must add peers topics into her own bloom filter. + aliceKeyID, err := aliceWhisperService.NewKeyPair() + s.Require().NoError(err) + s.createPrivateChatMessageFilter(aliceRPCClient, aliceKeyID, bobAliceKeySendTopic.String()) + s.createPrivateChatMessageFilter(aliceRPCClient, aliceKeyID, charlieAliceKeySendTopic.String()) + // Bob and charlie create message filter. bobMessageFilterID := s.createPrivateChatMessageFilter(bobRPCClient, bobKeyID, bobAliceKeySendTopic.String()) charlieMessageFilterID := s.createPrivateChatMessageFilter(charlieRPCClient, charlieKeyID, charlieAliceKeySendTopic.String())