Skip to content

Commit

Permalink
Remove the Local TSO test cases
Browse files Browse the repository at this point in the history
Signed-off-by: JmPotato <[email protected]>
  • Loading branch information
JmPotato committed Nov 14, 2024
1 parent 2f9bf48 commit e93c47b
Show file tree
Hide file tree
Showing 12 changed files with 129 additions and 1,159 deletions.
17 changes: 0 additions & 17 deletions .github/workflows/tso-consistency-test.yaml

This file was deleted.

20 changes: 4 additions & 16 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ SUBMODULES := $(filter $(shell find . -iname "go.mod" -exec dirname {} \;),\
test: install-tools
# testing all pkgs...
@$(FAILPOINT_ENABLE)
CGO_ENABLED=1 go test -tags tso_function_test,deadlock -timeout 20m -race -cover $(TEST_PKGS) || { $(FAILPOINT_DISABLE); exit 1; }
CGO_ENABLED=1 go test -tags deadlock -timeout 20m -race -cover $(TEST_PKGS) || { $(FAILPOINT_DISABLE); exit 1; }
@$(FAILPOINT_DISABLE)

basic-test: install-tools
Expand All @@ -257,24 +257,12 @@ ci-test-job: install-tools dashboard-ui pd-ut
./scripts/ci-subtask.sh $(JOB_INDEX) || { $(FAILPOINT_DISABLE); exit 1; }
@$(FAILPOINT_DISABLE)

TSO_INTEGRATION_TEST_PKGS := $(PD_PKG)/tests/server/tso

test-tso: install-tools
# testing TSO function & consistency...
@$(FAILPOINT_ENABLE)
CGO_ENABLED=1 go test -race -tags without_dashboard,tso_full_test,deadlock $(TSO_INTEGRATION_TEST_PKGS) || { $(FAILPOINT_DISABLE); exit 1; }
@$(FAILPOINT_DISABLE)
TSO_FUNCTION_TEST_PKGS := $(PD_PKG)/tests/server/tso

test-tso-function: install-tools
# testing TSO function...
@$(FAILPOINT_ENABLE)
CGO_ENABLED=1 go test -race -tags without_dashboard,tso_function_test,deadlock $(TSO_INTEGRATION_TEST_PKGS) || { $(FAILPOINT_DISABLE); exit 1; }
@$(FAILPOINT_DISABLE)

test-tso-consistency: install-tools
# testing TSO consistency...
@$(FAILPOINT_ENABLE)
CGO_ENABLED=1 go test -race -tags without_dashboard,tso_consistency_test,deadlock $(TSO_INTEGRATION_TEST_PKGS) || { $(FAILPOINT_DISABLE); exit 1; }
CGO_ENABLED=1 go test -race -tags without_dashboard,deadlock $(TSO_FUNCTION_TEST_PKGS) || { $(FAILPOINT_DISABLE); exit 1; }
@$(FAILPOINT_DISABLE)

REAL_CLUSTER_TEST_PATH := $(ROOT_PATH)/tests/integrations/realcluster
Expand Down Expand Up @@ -302,7 +290,7 @@ test-with-cover-parallel: install-tools dashboard-ui split

split:
# todo: it will remove server/api,/tests and tso packages after daily CI integrate all verify CI.
go list ./... | grep -v -E "github.com/tikv/pd/server/api|github.com/tikv/pd/tests/client|github.com/tikv/pd/tests/server/tso" > packages.list;\
go list ./... | grep -v -E "github.com/tikv/pd/server/api|github.com/tikv/pd/tests/client|$(TSO_FUNCTION_TEST_PKGS)" > packages.list;\
split packages.list -n r/${TASK_COUNT} packages_unit_ -a 1 --numeric-suffixes=1;\
cat packages_unit_${TASK_ID} |tr "\n" " " >package.list;\
rm packages*;
Expand Down
4 changes: 3 additions & 1 deletion pd.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@
"path": "tools"
}
],
"settings": {}
"settings": {
"makefile.configureOnOpen": false
}
}
28 changes: 0 additions & 28 deletions pkg/storage/storage_tso_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,6 @@ func TestSaveLoadTimestamp(t *testing.T) {
re.Equal(expectedTS, ts)
}

func TestGlobalLocalTimestamp(t *testing.T) {
re := require.New(t)
storage, clean := newTestStorage(t)
defer clean()
ltaKey := "lta"
dc1LocationKey, dc2LocationKey := "dc1", "dc2"
localTS1 := time.Now().Round(0)
l1 := path.Join(ltaKey, dc1LocationKey, keypath.TimestampKey)
l2 := path.Join(ltaKey, dc2LocationKey, keypath.TimestampKey)

err := storage.SaveTimestamp(l1, localTS1)
re.NoError(err)
globalTS := time.Now().Round(0)
err = storage.SaveTimestamp(keypath.TimestampKey, globalTS)
re.NoError(err)
localTS2 := time.Now().Round(0)
err = storage.SaveTimestamp(l2, localTS2)
re.NoError(err)
// return the max ts between global and local
ts, err := storage.LoadTimestamp("")
re.NoError(err)
re.Equal(localTS2, ts)
// return the local ts for a given dc location
ts, err = storage.LoadTimestamp(l1)
re.NoError(err)
re.Equal(localTS1, ts)
}

func TestTimestampTxn(t *testing.T) {
re := require.New(t)
storage, clean := newTestStorage(t)
Expand Down
11 changes: 1 addition & 10 deletions tests/server/member/member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,7 @@ func TestMemberDelete(t *testing.T) {
re := require.New(t)
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
dcLocationConfig := map[string]string{
"pd1": "dc-1",
"pd2": "dc-2",
"pd3": "dc-3",
}
dcLocationNum := len(dcLocationConfig)
cluster, err := tests.NewTestCluster(ctx, dcLocationNum, func(conf *config.Config, serverName string) {
conf.EnableLocalTSO = true
conf.Labels[config.ZoneLabel] = dcLocationConfig[serverName]
})
cluster, err := tests.NewTestCluster(ctx, 3)
defer cluster.Destroy()
re.NoError(err)

Expand Down
227 changes: 0 additions & 227 deletions tests/server/tso/allocator_test.go

This file was deleted.

Loading

0 comments on commit e93c47b

Please sign in to comment.