Skip to content

Commit

Permalink
Fix flake in TestUpdateAdmittedNoWorker
Browse files Browse the repository at this point in the history
Don't even attempt to start the worker
  • Loading branch information
Quinn-With-Two-Ns committed Jun 7, 2024
1 parent c73a007 commit 3cada5a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,11 @@ func (ts *IntegrationTestSuite) SetupTest() {
ts.worker = worker.New(ts.client, ts.taskQueueName, options)
ts.workerStopped = false
ts.registerWorkflowsAndActivities(ts.worker)
if strings.Contains(ts.T().Name(), "NoWorker") {
// Don't even start the worker
ts.workerStopped = true
return
}
ts.Nil(ts.worker.Start())
}

Expand Down Expand Up @@ -2847,12 +2852,11 @@ func (ts *IntegrationTestSuite) TestLongUpdateWaitOnCompleted() {

func (ts *IntegrationTestSuite) TestUpdateAdmittedNoWorker() {
ctx := context.Background()

run, err := ts.client.ExecuteWorkflow(ctx,
ts.startWorkflowOptions("test-long-update-wait-on-completed"), ts.workflows.UpdateBasicWorkflow)
ts.Nil(err)

ts.worker.Stop()
ts.workerStopped = true
defer ts.NoError(ts.client.TerminateWorkflow(ctx, run.GetID(), run.GetRunID(), "for test"))

// Send an update request
tctx, cancel := context.WithTimeout(ctx, 10*time.Second)
Expand All @@ -2865,9 +2869,6 @@ func (ts *IntegrationTestSuite) TestUpdateAdmittedNoWorker() {
WaitForStage: client.WorkflowUpdateStageAccepted,
})
ts.Error(err)

// complete workflow
ts.NoError(ts.client.TerminateWorkflow(ctx, run.GetID(), run.GetRunID(), "for test"))
}

func (ts *IntegrationTestSuite) TestUpdateWithNoHandlerRejected() {
Expand Down

0 comments on commit 3cada5a

Please sign in to comment.