diff --git a/cmd/xmidt-agent/config.go b/cmd/xmidt-agent/config.go index 27f76e5..8a818b6 100644 --- a/cmd/xmidt-agent/config.go +++ b/cmd/xmidt-agent/config.go @@ -369,7 +369,7 @@ var defaultConfig = Config{ }, }, Pubsub: Pubsub{ - PublishTimeout: 200 * time.Millisecond, + PublishTimeout: 5 * time.Second, }, Logger: sallust.Config{ EncoderConfig: sallust.EncoderConfig{ diff --git a/internal/adapters/libparodus/end2end_test.go b/internal/adapters/libparodus/end2end_test.go index 03bab01..cc44615 100644 --- a/internal/adapters/libparodus/end2end_test.go +++ b/internal/adapters/libparodus/end2end_test.go @@ -124,7 +124,7 @@ func TestEnd2End(t *testing.T) { require.NoError(err) require.NotEmpty(self) - ps, err := pubsub.New(self) + ps, err := pubsub.New(self, pubsub.WithPublishTimeout(200*time.Millisecond)) require.NoError(err) require.NotNil(ps) diff --git a/internal/pubsub/end2end_test.go b/internal/pubsub/end2end_test.go index 2f2e4eb..d19aacf 100644 --- a/internal/pubsub/end2end_test.go +++ b/internal/pubsub/end2end_test.go @@ -226,6 +226,7 @@ func TestEndToEnd(t *testing.T) { wrp.EnsureTransactionUUID(), wrp.ValidateOnlyUTF8Strings(), ), + pubsub.WithPublishTimeout(200*time.Millisecond), ) require.NoError(err) diff --git a/internal/pubsub/pubsub.go b/internal/pubsub/pubsub.go index 53714a5..5061ee1 100644 --- a/internal/pubsub/pubsub.go +++ b/internal/pubsub/pubsub.go @@ -69,13 +69,6 @@ func New(self wrp.DeviceID, opts ...Option) (*PubSub, error) { ), } - defaults := []Option{ - WithPublishTimeout(5 * time.Second), - } - - // Prepend the defaults to the provided options. - opts = append(defaults, opts...) - for _, opt := range opts { if opt != nil { if err := opt.apply(&ps); err != nil {