Skip to content

Commit

Permalink
test(pubsub): use default MinExtensionPeriod for exactly once tests (#…
Browse files Browse the repository at this point in the history
…8502)

* test(pubsub): update retry deadlines for exactly once tests

* use default MinExtensionPeriod, which is higher when eod is enabled

* add debug log
  • Loading branch information
hongalex authored Aug 31, 2023
1 parent 9d1c775 commit a05b6ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pubsub/subscription_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"errors"
"fmt"
"log"
"testing"
"time"

Expand Down Expand Up @@ -689,12 +690,11 @@ func TestExactlyOnceDelivery_AckRetryDeadlineExceeded(t *testing.T) {

s.ReceiveSettings = ReceiveSettings{
NumGoroutines: 1,
// This needs to be greater than total deadline otherwise the message will be redelivered.
MinExtensionPeriod: 30 * time.Second,
}
// Override the default timeout here so this test doesn't take 10 minutes.
exactlyOnceDeliveryRetryDeadline = 10 * time.Second
err = s.Receive(ctx, func(ctx context.Context, msg *Message) {
log.Printf("received message: %v\n", msg)
ar := msg.AckWithResult()
s, err := ar.Get(ctx)
if s != AcknowledgeStatusOther {
Expand Down

0 comments on commit a05b6ed

Please sign in to comment.