Skip to content

Commit

Permalink
test: fix TestDDLStatsInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
tangenta committed Nov 18, 2022
1 parent 2a46f6c commit be18d60
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ddl/stat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package ddl_test

import (
"context"
"encoding/hex"
"fmt"
"strconv"
"testing"
Expand All @@ -33,6 +34,7 @@ import (
"github.com/pingcap/tidb/sessionctx"
"github.com/pingcap/tidb/sessionctx/variable"
"github.com/pingcap/tidb/sessiontxn"
"github.com/pingcap/tidb/tablecodec"
"github.com/pingcap/tidb/testkit"
"github.com/pingcap/tidb/types"
"github.com/stretchr/testify/require"
Expand Down Expand Up @@ -89,7 +91,11 @@ func TestDDLStatsInfo(t *testing.T) {
varMap, err := d.Stats(nil)
wg.Done()
require.NoError(t, err)
require.Equal(t, "1", varMap[ddlJobReorgHandle])
key, err := hex.DecodeString(varMap[ddlJobReorgHandle].(string))
require.NoError(t, err)
_, h, err := tablecodec.DecodeRecordKey(key)
require.NoError(t, err)
require.Equal(t, h.IntValue(), int64(1))
}
}
}
Expand Down

0 comments on commit be18d60

Please sign in to comment.