Skip to content

Commit

Permalink
disable sem after test
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Jul 15, 2022
1 parent aef7f65 commit 925b1be
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions ddl/db_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@ func TestIssue34069(t *testing.T) {
store, clean := testkit.CreateMockStore(t)
defer clean()
sem.Enable()
defer sem.Disable()

tk := testkit.NewTestKit(t, store)
tk.Session().Auth(&auth.UserIdentity{Username: "root", Hostname: "%"}, nil, nil)
Expand Down
4 changes: 1 addition & 3 deletions ddl/tiflash_replica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import (
"github.com/pingcap/tidb/tablecodec"
"github.com/pingcap/tidb/testkit"
"github.com/pingcap/tidb/testkit/external"
"github.com/pingcap/tidb/util/sem"
"github.com/stretchr/testify/require"
)

Expand Down Expand Up @@ -187,8 +186,7 @@ func TestSetTableFlashReplicaForSystemTable(t *testing.T) {
for _, one := range sysTables {
_, err := tk.Exec(fmt.Sprintf("alter table `%s` set tiflash replica 1", one))
if db == "MySQL" {
msg := fmt.Sprintf("sem enabled: %v", sem.IsEnabled())
require.Equal(t, "[ddl:8200]ALTER table replica for tables in system database is currently unsupported", err.Error(), msg)
require.Equal(t, "[ddl:8200]ALTER table replica for tables in system database is currently unsupported", err.Error())
} else {
require.Equal(t, fmt.Sprintf("[planner:1142]ALTER command denied to user 'root'@'%%' for table '%s'", strings.ToLower(one)), err.Error())
}
Expand Down

0 comments on commit 925b1be

Please sign in to comment.