From be6396c725e0aa58bf54b2ffd31ebc8a940edbed Mon Sep 17 00:00:00 2001 From: tangenta Date: Sat, 28 Dec 2024 15:15:51 +0800 Subject: [PATCH] test: stabilize TestGetAndResetRecentInfoSchemaTS (#58589) close pingcap/tidb#58453 --- pkg/infoschema/cache.go | 2 +- pkg/infoschema/test/infoschemav2test/v2_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/infoschema/cache.go b/pkg/infoschema/cache.go index 348960c709..317749bb1b 100644 --- a/pkg/infoschema/cache.go +++ b/pkg/infoschema/cache.go @@ -74,7 +74,7 @@ func NewCache(r autoid.Requirement, capacity int) *InfoCache { // The keepAlive() function will compare the InfoSchemaV2's ts with Data.recentMinTS, and // update the Data.recentMinTS to smaller one. // -// In a nutshell, every round of ReportMinStartTS(), the minimal known TS used be InfoSchemaV2 APIs will be reported. +// In a nutshell, every round of ReportMinStartTS(), the minimal known TS used by InfoSchemaV2 APIs will be reported. // Some corner cases might happen: the caller take an InfoSchemaV2 instance and not use it immediately. // Seveval rounds later, that InfoSchema is used and its TS is reported to block GC safepoint advancing. // But that's too late, the GC has been done, "GC life time is shorter than transaction duration" error still happen. diff --git a/pkg/infoschema/test/infoschemav2test/v2_test.go b/pkg/infoschema/test/infoschemav2test/v2_test.go index f476a54ba3..d0e2f315e1 100644 --- a/pkg/infoschema/test/infoschemav2test/v2_test.go +++ b/pkg/infoschema/test/infoschemav2test/v2_test.go @@ -563,6 +563,7 @@ func TestInfoSchemaCachedAutoIncrement(t *testing.T) { func TestGetAndResetRecentInfoSchemaTS(t *testing.T) { store, dom := testkit.CreateMockStoreAndDomain(t) tk := testkit.NewTestKit(t, store) + tk.MustExec("set @@global.tidb_schema_cache_size = 1024 * 1024 * 1024") // For mocktikv, safe point is not initialized, we manually insert it for snapshot to use. timeSafe := time.Now().Add(-48 * 60 * 60 * time.Second).Format("20060102-15:04:05 -0700 MST")