From 2c1af5e705abed0ea4347366c10212eb548bb5dc Mon Sep 17 00:00:00 2001 From: sugimoto_e Date: Wed, 19 Jun 2024 21:51:48 +0900 Subject: [PATCH 1/4] add test for send task --- pkg/domain/plan_replayer_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pkg/domain/plan_replayer_test.go b/pkg/domain/plan_replayer_test.go index f182be2c8907c..10ab2b0c455d9 100644 --- a/pkg/domain/plan_replayer_test.go +++ b/pkg/domain/plan_replayer_test.go @@ -136,3 +136,17 @@ func TestDumpGCFileParseTime(t *testing.T) { _, err = parseTime(pName) require.NoError(t, err) } + +func TestSendTask(t *testing.T) { + h := &planReplayerHandle{ + planReplayerTaskDumpHandle: &planReplayerTaskDumpHandle{ + taskCH: make(chan *PlanReplayerDumpTask, 1), + }, + planReplayerTaskCollectorHandle: &planReplayerTaskCollectorHandle{}, + } + task1 := &PlanReplayerDumpTask{} + task2 := &PlanReplayerDumpTask{} + h.SendTask(task1) + success := h.SendTask(task2) + require.False(t, success) +} From f0a83fb69c8eab6050a67d82c16f4000076b3af9 Mon Sep 17 00:00:00 2001 From: sugimoto_e Date: Sun, 23 Jun 2024 02:15:23 +0900 Subject: [PATCH 2/4] fix : ci : Applying the presented git diff --- pkg/domain/BUILD.bazel | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/domain/BUILD.bazel b/pkg/domain/BUILD.bazel index db92af1d8f166..8fbea59c8b8f4 100644 --- a/pkg/domain/BUILD.bazel +++ b/pkg/domain/BUILD.bazel @@ -134,7 +134,7 @@ go_test( ], embed = [":domain"], flaky = True, - shard_count = 27, + shard_count = 28, deps = [ "//pkg/config", "//pkg/ddl", From 255c08f58cd611da3c204a2054fd2dab5e9c34f1 Mon Sep 17 00:00:00 2001 From: sugimoto_e Date: Sun, 23 Jun 2024 21:03:58 +0900 Subject: [PATCH 3/4] feat: add `NOGO_FLAG` argment --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d2c6fcbbfd833..b45fabe49ce88 100644 --- a/Makefile +++ b/Makefile @@ -624,12 +624,13 @@ bazel_coverage_test: failpoint-enable bazel_ci_simple_prepare -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... .PHONY: bazel_build +NOGO_FLAG=true bazel_build: mkdir -p bin bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \ - //... --//build:with_nogo_flag=true + //... --//build:with_nogo_flag=$(NOGO_FLAG) bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \ - //cmd/importer:importer //cmd/tidb-server:tidb-server //cmd/tidb-server:tidb-server-check --//build:with_nogo_flag=true + //cmd/importer:importer //cmd/tidb-server:tidb-server //cmd/tidb-server:tidb-server-check --//build:with_nogo_flag=$(NOGO_FLAG) cp bazel-out/k8-fastbuild/bin/cmd/tidb-server/tidb-server_/tidb-server ./bin cp bazel-out/k8-fastbuild/bin/cmd/importer/importer_/importer ./bin cp bazel-out/k8-fastbuild/bin/cmd/tidb-server/tidb-server-check_/tidb-server-check ./bin @@ -778,8 +779,9 @@ bazel_flashbacktest: failpoint-enable bazel_ci_simple_prepare ./build/jenkins_collect_coverage.sh .PHONY: bazel_lint +NOGO_FLAG=true bazel_lint: bazel_prepare - bazel build //... --//build:with_nogo_flag=true + bazel build //... --//build:with_nogo_flag=$(NOGO_FLAG) .PHONY: docker docker: From 61cf21701b5b2d7a419675b5559e47f72e868493 Mon Sep 17 00:00:00 2001 From: ei-sugimoto Date: Tue, 25 Jun 2024 15:26:12 +0900 Subject: [PATCH 4/4] feat: move `NOGO_FLAG` to `Makefile.common` --- Makefile | 2 -- Makefile.common | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b45fabe49ce88..511c605092d43 100644 --- a/Makefile +++ b/Makefile @@ -624,7 +624,6 @@ bazel_coverage_test: failpoint-enable bazel_ci_simple_prepare -//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/... .PHONY: bazel_build -NOGO_FLAG=true bazel_build: mkdir -p bin bazel $(BAZEL_GLOBAL_CONFIG) build $(BAZEL_CMD_CONFIG) \ @@ -779,7 +778,6 @@ bazel_flashbacktest: failpoint-enable bazel_ci_simple_prepare ./build/jenkins_collect_coverage.sh .PHONY: bazel_lint -NOGO_FLAG=true bazel_lint: bazel_prepare bazel build //... --//build:with_nogo_flag=$(NOGO_FLAG) diff --git a/Makefile.common b/Makefile.common index b540debd422e0..94cd9734d2582 100644 --- a/Makefile.common +++ b/Makefile.common @@ -131,3 +131,5 @@ ifneq ("$(CI)", "") BAZEL_SYNC_CONFIG := --repository_cache=/home/jenkins/.tidb/tmp endif BAZEL_INSTRUMENTATION_FILTER := --instrument_test_targets --instrumentation_filter=//pkg/...,//br/...,//dumpling/... + +NOGO_FLAG=true \ No newline at end of file