From 1d36ac37cf00f94594fecef6749010502b2d5a22 Mon Sep 17 00:00:00 2001 From: D3Hunter Date: Thu, 23 May 2024 16:10:19 +0800 Subject: [PATCH] test: fix flaky test TestSyncJobSchemaVerLoop (#53507) close pingcap/tidb#53508 --- pkg/ddl/syncer/syncer.go | 1 + pkg/ddl/syncer/syncer_nokit_test.go | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/ddl/syncer/syncer.go b/pkg/ddl/syncer/syncer.go index 5b1212ab12ebdc..df6044716eb2b2 100644 --- a/pkg/ddl/syncer/syncer.go +++ b/pkg/ddl/syncer/syncer.go @@ -434,6 +434,7 @@ func (s *schemaVersionSyncer) OwnerCheckAllVersions(ctx context.Context, jobID i case <-notifyCh: return nil case <-ctx.Done(): + item.clearMatchFn() return errors.Trace(ctx.Err()) case <-time.After(time.Second): item.clearMatchFn() diff --git a/pkg/ddl/syncer/syncer_nokit_test.go b/pkg/ddl/syncer/syncer_nokit_test.go index e9f931b77ed50e..15d0cbf0eac447 100644 --- a/pkg/ddl/syncer/syncer_nokit_test.go +++ b/pkg/ddl/syncer/syncer_nokit_test.go @@ -188,6 +188,4 @@ func TestSyncJobSchemaVerLoop(t *testing.T) { cancel() wg.Wait() - - require.Zero(t, jobNodeVersionCnt()) }