Skip to content

Commit 87ae80e

Browse files
committed
use reasonable timeout for newTaskQueuePartitionManager in tests instead
of context.Background()
1 parent be61432 commit 87ae80e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

service/matching/task_queue_partition_manager_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,14 @@ func (s *PartitionManagerTestSuite) SetupTest() {
8585
tqConfig := newTaskQueueConfig(partition.TaskQueue(), engine.config, ns.Name())
8686
s.userDataMgr = &mockUserDataManager{}
8787

88-
pm, err := newTaskQueuePartitionManager(context.Background(), engine, ns, partition, tqConfig, logger, logger, metrics.NoopMetricsHandler, s.userDataMgr)
88+
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond)
89+
pm, err := newTaskQueuePartitionManager(ctx, engine, ns, partition, tqConfig, logger, logger, metrics.NoopMetricsHandler, s.userDataMgr)
8990
s.NoError(err)
9091
s.partitionMgr = pm
92+
cancel()
9193
engine.Start()
9294
pm.Start()
93-
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Millisecond)
95+
ctx, cancel = context.WithTimeout(context.Background(), 10*time.Millisecond)
9496
defer cancel()
9597
err = pm.WaitUntilInitialized(ctx)
9698
s.NoError(err)

0 commit comments

Comments
 (0)