Skip to content

unstable test TestWaitTTLJobFinish #45445

@hawkingrei

Description

@hawkingrei

Bug Report

Please answer these questions before submitting your issue. Thanks!

1. Minimal reproduce step (Required)

2. What did you expect to see? (Required)

3. What did you see instead (Required)

 --- FAIL: TestWaitTTLJobFinish (0.05s)
panic: 
assert: mock: The method has been called over 1 times.
	Either do one more Mock.On("GetJob").Return(...), or remove extra call.
	This call was unexpected:
		GetJob(*context.timerCtx,int64,int64,string)
		0: &context.timerCtx{cancelCtx:(*context.cancelCtx)(0xc000178c80), timer:(*time.Timer)(nil), deadline:time.Time{wall:0xc125b5c0f955f6f6, ext:60351749793, loc:(*time.Location)(0xbfa3760)}}
		1: 1
		2: 2
		3: "c2e10aeb-86dc-4812-afea-697b2bc8a25e"
	at: [ttl/ttlworker/timer_test.go:51 ttl/ttlworker/timer.go:213 ttl/ttlworker/timer_test.go:530] [recovered]
	panic: 
assert: mock: The method has been called over 1 times.
	Either do one more Mock.On("GetJob").Return(...), or remove extra call.
	This call was unexpected:
		GetJob(*context.timerCtx,int64,int64,string)
		0: &context.timerCtx{cancelCtx:(*context.cancelCtx)(0xc000178c80), timer:(*time.Timer)(nil), deadline:time.Time{wall:0xc125b5c0f955f6f6, ext:60351749793, loc:(*time.Location)(0xbfa3760)}}
		1: 1
		2: 2
		3: "c2e10aeb-86dc-4812-afea-697b2bc8a25e"
	at: [ttl/ttlworker/timer_test.go:51 ttl/ttlworker/timer.go:213 ttl/ttlworker/timer_test.go:530]
goroutine 142 [running]:
testing.tRunner.func1.2({0x1b47c20, 0xc0012ad040})
	GOROOT/src/testing/testing.go:1526 +0x372
testing.tRunner.func1()
	GOROOT/src/testing/testing.go:1529 +0x650
panic({0x1b47c20, 0xc0012ad040})
	GOROOT/src/runtime/panic.go:890 +0x263
github.com/stretchr/testify/mock.(*Mock).fail(0xc000617ef0, {0x246a6e2, 0xa5}, {0xc0012a6d80, 0x4, 0x4})
	external/com_github_stretchr_testify/mock/mock.go:332 +0x1db
github.com/stretchr/testify/mock.(*Mock).MethodCalled(0xc000617ef0, {0x42fae84, 0x6}, {0xc0012a6a80, 0x4, 0x4})
	external/com_github_stretchr_testify/mock/mock.go:480 +0x33d
github.com/stretchr/testify/mock.(*Mock).Called(0xc0012372f0?, {0xc0012a6a80, 0x4, 0x4})
	external/com_github_stretchr_testify/mock/mock.go:464 +0x1a5
github.com/pingcap/tidb/ttl/ttlworker.(*mockJobAdapter).GetJob(0xc000617ef0, {0x3bf6960?, 0xc00117eea0}, 0xc001182100?, 0x20?, {0xc0012372f0, 0x24})
	ttl/ttlworker/timer_test.go:51 +0x205
github.com/pingcap/tidb/ttl/ttlworker.(*ttlTimerHook).waitJobFinished(0xc000b26de0, 0xc0001e2fc0, 0xc000364060, {0xc001182100, 0x20}, {0xc0012372f0, 0x24}, {0xc125b5b17954f38f, 0xffffffff9dc0af4f, 0xbfa3760})
	ttl/ttlworker/timer.go:213 +0x64e
github.com/pingcap/tidb/ttl/ttlworker.TestWaitTTLJobFinish(0x0?)
	ttl/ttlworker/timer_test.go:530 +0x3df5
testing.tRunner(0xc000af9380, 0x24c6550)
	GOROOT/src/testing/testing.go:1576 +0x217
created by testing.(*T).Run
	GOROOT/src/testing/testing.go:1629 +0x806
-- 

https://tiprow.hawkingrei.com/view/gs/pingcapprow/pr-logs/pull/pingcap_tidb/45434/tiprow_fast_test/1681233855941447680

4. What is your TiDB version? (Required)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions