Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yash.bansal committed Sep 12, 2024
1 parent 1447c26 commit 9a6c148
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pubsub/tests/test_asserts.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func AssertAllMessagesHaveSameContext(t *testing.T, contextKeyString string, exp
assert.Len(t, received, len(expectedValues))
for _, msg := range received {
expectedValue := expectedValues[msg.UUID].Value(contextKey(contextKeyString)).(string)
actualValue := msg.Context().Value(contextKeyString)
actualValue := msg.Context().Value(contextKey(contextKeyString))
assert.Equal(t, expectedValue, actualValue)
}
}
4 changes: 3 additions & 1 deletion pubsub/tests/test_pubsub.go
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,9 @@ ClosedLoop:

receivedMessages, _ := bulkRead(tCtx, msgs, messagesCount, defaultTimeout)
AssertAllMessagesReceived(t, publishedMessages, receivedMessages)
AssertAllMessagesHaveSameContext(t, contextKeyString, expectedContexts, receivedMessages)
if tCtx.Features.ContextPreserved {
AssertAllMessagesHaveSameContext(t, contextKeyString, expectedContexts, receivedMessages)
}
}

// TestReconnect tests if reconnecting to a Pub/Sub works correctly.
Expand Down

0 comments on commit 9a6c148

Please sign in to comment.