Skip to content
Snippets Groups Projects
Commit 36a283c1 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Fix the associated test w/ duplicate receives

parent 19ddcd63
No related branches found
No related tags found
2 merge requests!129Do not error out when this message already exists inside the DB. Instead, set...,!109Project/haven beta
...@@ -413,13 +413,16 @@ func Test_wasmModel_DuplicateReceives(t *testing.T) { ...@@ -413,13 +413,16 @@ func Test_wasmModel_DuplicateReceives(t *testing.T) {
} }
// Store duplicate messages with same messageID // Store duplicate messages with same messageID
referenceID := uint64(0)
for i := 0; i < 10; i++ { for i := 0; i < 10; i++ {
uuid = eventModel.ReceiveMessage(channelID, msgID, "test", uuid = eventModel.ReceiveMessage(channelID, msgID, "test",
testString+fmt.Sprintf("%d", i), []byte{8, 6, 7, 5}, 0, 0, testString+fmt.Sprintf("%d", i), []byte{8, 6, 7, 5}, 0, 0,
netTime.Now(), time.Hour, rnd, 0, channels.Sent, false) netTime.Now(), time.Hour, rnd, 0, channels.Sent, false)
if uuid != 0 { if referenceID == 0 {
t.Fatalf("Expected UUID to be zero for duplicate receives") referenceID = uuid
} }
require.Equal(t, referenceID, uuid,
"UUID must be identical for duplicate receives")
} }
}) })
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment