Skip to content

Commit

Permalink
test(pubsub): remove duplicate ctx assignment in ordered keys test (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
hongalex committed Feb 27, 2024
1 parent 2577611 commit 2ac1bcc
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pubsub/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,7 @@ func TestIntegration_OrderedKeys_Basic(t *testing.T) {
}

received := make(chan string, numItems)
ctx, cancel := context.WithCancel(ctx)
ctx2, cancel := context.WithCancel(ctx)
go func() {
for i := 0; i < numItems; i++ {
select {
Expand All @@ -1193,7 +1193,7 @@ func TestIntegration_OrderedKeys_Basic(t *testing.T) {
cancel()
}()

if err := sub.Receive(ctx, func(ctx context.Context, msg *Message) {
if err := sub.Receive(ctx2, func(ctx context.Context, msg *Message) {
defer msg.Ack()
if msg.OrderingKey != orderingKey {
t.Errorf("got ordering key %s, expected %s", msg.OrderingKey, orderingKey)
Expand Down Expand Up @@ -1502,7 +1502,7 @@ func TestIntegration_OrderingWithExactlyOnce(t *testing.T) {
}

received := make(chan string, numItems)
ctx, cancel := context.WithCancel(ctx)
ctx2, cancel := context.WithCancel(ctx)
go func() {
for i := 0; i < numItems; i++ {
select {
Expand All @@ -1518,7 +1518,7 @@ func TestIntegration_OrderingWithExactlyOnce(t *testing.T) {
cancel()
}()

if err := sub.Receive(ctx, func(ctx context.Context, msg *Message) {
if err := sub.Receive(ctx2, func(ctx context.Context, msg *Message) {
defer msg.Ack()
if msg.OrderingKey != orderingKey {
t.Errorf("got ordering key %s, expected %s", msg.OrderingKey, orderingKey)
Expand Down

0 comments on commit 2ac1bcc

Please sign in to comment.