diff --git a/Makefile b/Makefile index 4afd22a3ce7..e1f4485144b 100644 --- a/Makefile +++ b/Makefile @@ -413,13 +413,13 @@ prepare-coverage-test: $(GOTESTSUM) $(TEST_OUTPUT_ROOT) unit-test-coverage: prepare-coverage-test @printf $(COLOR) "Run unit tests with coverage..." - go run ./cmd/tools/test-runner $(GOTESTSUM) -retries $(FAILED_TEST_RETRIES) --junitfile $(NEW_REPORT) --packages $(UNIT_TEST_DIRS) -- \ + go run ./cmd/tools/test-runner $(GOTESTSUM) -retries=$(FAILED_TEST_RETRIES) --junitfile=$(NEW_REPORT) --packages="$(UNIT_TEST_DIRS)" -- \ $(COMPILED_TEST_ARGS) \ -coverprofile=$(NEW_COVER_PROFILE) integration-test-coverage: prepare-coverage-test @printf $(COLOR) "Run integration tests with coverage..." - go run ./cmd/tools/test-runner $(GOTESTSUM) -retries $(FAILED_TEST_RETRIES) --junitfile $(NEW_REPORT) --packages $(INTEGRATION_TEST_DIRS) -- \ + go run ./cmd/tools/test-runner $(GOTESTSUM) -retries=$(FAILED_TEST_RETRIES) --junitfile=$(NEW_REPORT) --packages="$(INTEGRATION_TEST_DIRS)" -- \ $(COMPILED_TEST_ARGS) \ -coverprofile=$(NEW_COVER_PROFILE) $(INTEGRATION_TEST_COVERPKG) @@ -429,21 +429,21 @@ pre-build-functional-test-coverage: prepare-coverage-test functional-test-coverage: prepare-coverage-test @printf $(COLOR) "Run functional tests with coverage with $(PERSISTENCE_DRIVER) driver..." - go run ./cmd/tools/test-runner $(GOTESTSUM) -retries $(FAILED_TEST_RETRIES) --junitfile $(NEW_REPORT) --packages $(FUNCTIONAL_TEST_ROOT) -- \ + go run ./cmd/tools/test-runner $(GOTESTSUM) -retries=$(FAILED_TEST_RETRIES) --junitfile=$(NEW_REPORT) --packages="$(FUNCTIONAL_TEST_ROOT)" -- \ $(COMPILED_TEST_ARGS) \ -coverprofile=$(NEW_COVER_PROFILE) $(FUNCTIONAL_TEST_COVERPKG) \ -args -persistenceType=$(PERSISTENCE_TYPE) -persistenceDriver=$(PERSISTENCE_DRIVER) functional-test-xdc-coverage: prepare-coverage-test @printf $(COLOR) "Run functional test for cross DC with coverage with $(PERSISTENCE_DRIVER) driver..." - go run ./cmd/tools/test-runner $(GOTESTSUM) -retries $(FAILED_TEST_RETRIES) --junitfile $(NEW_REPORT) --packages $(FUNCTIONAL_TEST_XDC_ROOT) -- \ + go run ./cmd/tools/test-runner $(GOTESTSUM) -retries=$(FAILED_TEST_RETRIES) --junitfile=$(NEW_REPORT) --packages="$(FUNCTIONAL_TEST_XDC_ROOT)" -- \ $(COMPILED_TEST_ARGS) \ -coverprofile=$(NEW_COVER_PROFILE) $(FUNCTIONAL_TEST_COVERPKG) \ -args -persistenceType=$(PERSISTENCE_TYPE) -persistenceDriver=$(PERSISTENCE_DRIVER) functional-test-ndc-coverage: prepare-coverage-test @printf $(COLOR) "Run functional test for NDC with coverage with $(PERSISTENCE_DRIVER) driver..." - go run ./cmd/tools/test-runner $(GOTESTSUM) -retries $(FAILED_TEST_RETRIES) --junitfile $(NEW_REPORT) --packages $(FUNCTIONAL_TEST_NDC_ROOT) -- \ + go run ./cmd/tools/test-runner $(GOTESTSUM) -retries=$(FAILED_TEST_RETRIES) --junitfile=$(NEW_REPORT) --packages="$(FUNCTIONAL_TEST_NDC_ROOT)" -- \ $(COMPILED_TEST_ARGS) \ -coverprofile=$(NEW_COVER_PROFILE) $(FUNCTIONAL_TEST_COVERPKG) \ -args -persistenceType=$(PERSISTENCE_TYPE) -persistenceDriver=$(PERSISTENCE_DRIVER) diff --git a/common/persistence/tests/sqlite_test.go b/common/persistence/tests/sqlite_test.go index 7d09c7d4b3b..e330411294a 100644 --- a/common/persistence/tests/sqlite_test.go +++ b/common/persistence/tests/sqlite_test.go @@ -1187,7 +1187,7 @@ func TestSQLiteTransactionContextCancellation(t *testing.T) { cancel() err = tx.Commit() - assert.ErrorAs(t, err, &context.Canceled) + assert.ErrorIs(t, err, context.Canceled) // Check if we still have a connection to the db. _, err = db.LockTaskQueues(context.Background(), sqlplugin.TaskQueuesFilter{ diff --git a/tools/tdbg/dlq_service_test.go b/tools/tdbg/dlq_service_test.go index 3e6bc1a24d1..9c2a258b979 100644 --- a/tools/tdbg/dlq_service_test.go +++ b/tools/tdbg/dlq_service_test.go @@ -79,7 +79,7 @@ type ( } ) -func (tc *dlqTestCase) Run(t *testing.T, firstAppRun chan struct{}) { +func (tc *dlqTestCase) Run(t *testing.T) { faultyAdminClient := &fakeAdminClient{err: errors.New("did not expect client to be used")} p := dlqTestParams{ dlqVersion: tc.version, @@ -116,16 +116,8 @@ func (tc *dlqTestCase) Run(t *testing.T, firstAppRun chan struct{}) { } runArgs = appendArg(runArgs, tdbg.FlagOutputFilename, p.outputFileName) - // TODO: this is a hack to make sure that the first app.Run() call is finished before the second one starts because - // there is a race condition in the CLI app where all apps share the same help command pointer and try to initialize - // it at the same time. This workaround only protects the first call because it's ok if subsequent calls happen in - // parallel since the help command is already initialized. - _, isFirstRun := <-firstAppRun t.Logf("Running %v", runArgs) err := app.Run(runArgs) - if isFirstRun { - close(firstAppRun) - } if len(p.expectedErrSubstrings) > 0 { assert.Error(t, err, "Expected error to contain %v", p.expectedErrSubstrings) for _, s := range p.expectedErrSubstrings { @@ -144,10 +136,6 @@ func (tc *dlqTestCase) Run(t *testing.T, firstAppRun chan struct{}) { } func TestDLQCommand_V2(t *testing.T) { - t.Parallel() - - firstAppRun := make(chan struct{}, 1) - firstAppRun <- struct{}{} for _, tc := range []dlqTestCase{ { name: "read no target cluster with faulty admin client", @@ -309,9 +297,8 @@ func TestDLQCommand_V2(t *testing.T) { }, } { t.Run(tc.name, func(t *testing.T) { - t.Parallel() tc.version = "v2" - tc.Run(t, firstAppRun) + tc.Run(t) }) } }