diff --git a/domain/schema_validator_test.go b/domain/schema_validator_test.go index 78c2b394c4cde..05a9b567f5e28 100644 --- a/domain/schema_validator_test.go +++ b/domain/schema_validator_test.go @@ -18,6 +18,7 @@ import ( "time" . "github.com/pingcap/check" + "github.com/pingcap/tidb/store/tikv/oracle" "github.com/pingcap/tidb/util/testleak" ) @@ -60,10 +61,13 @@ func (*testSuite) TestSchemaValidator(c *C) { validator.Restart() // Sleep for a long time, check schema is invalid. + ts := <-oracleCh // Make sure that ts has timed out a lease. time.Sleep(lease) - ts := <-oracleCh + ts = <-oracleCh valid = validator.Check(ts, item.schemaVer, []int64{10}) - c.Assert(valid, Equals, ResultUnknown) + ms := oracle.ExtractPhysical(ts) + c.Assert(valid, Equals, ResultUnknown, Commentf("validator latest schema ver %v, time %v, item schema ver %v, ts %v", + validator.latestSchemaVer, validator.latestSchemaExpire, item.schemaVer, time.Unix(ms/1e3, (ms%1e3)*1e6))) currVer := reload(validator, leaseGrantCh, 0) valid = validator.Check(ts, item.schemaVer, []int64{0})