tests: TestNextGenMetering rejects valid zero-second task durations
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start with TestNextGenMetering in tests/realtikvtest/importintotest4 and compare its duration polling assertion with the analogous fix in tests/realtikvtest/addindextest2. Review pkg/dxf/framework/handle/handle.go to confirm the integer duration behavior, then run the focused test; it is done when valid completed tasks with zero-second durations satisfy the assertion without a timeout.
Written by the indexing model from the issue text.
Description
Bug Report
1. Minimal reproduce step (Required)
TestNextGenMetering in tests/realtikvtest/importintotest4 asserts that duration_seconds > 0 for a small three-row import. Consider a successful task whose recorded start/end duration is less than one second.
Production code in pkg/dxf/framework/handle/handle.go calculates the value as int64(task.StateUpdateTime.Sub(task.CreateTime).Seconds()), which truncates a positive sub-second duration to zero.
2. What did you expect to see? (Required)
The metering assertion accepts a non-negative integer duration, including zero. The analogous assertion in tests/realtikvtest/addindextest2 was fixed in #68453.
3. What did you see instead (Required)
Severity: minor. The zero-second boundary follows from the integer-duration calculation, but no matching failure or high-probability triggering has been established for this test in CI. A full local NextGen run has not been performed.
A valid zero value cannot satisfy the polling condition, so the assertion will time out after 30 seconds. Waiting longer does not change the duration of an already completed task.
This is a code-confirmed boundary condition; a full local NextGen reproduction is not available. The separate nil-pointer polling issue is already covered by #69217 and is outside this issue's scope.
4. What is your TiDB version? (Required)
TiDB master at 8bccb81a1c0a81d33ebca76545e465535e374870, NextGen test path.
- Dominant language
- Go
- Stars
- 40.6k
- Forks
- 6.2k
- Avg merge
- 3d 3h
- Merged PRs (30d)
- 168
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pingcap/tidb
-
affects-9.0 found-by-ai may-affects-25.10 may-affects-26.3 may-affects-26.9 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major sig/execution type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
affects-8.1 affects-8.5 component/statistics severity/moderate type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
affects-26.3 affects-9.0 component/ddl found-by-ai severity/major type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
contribution may-affects-25.10 may-affects-26.3 may-affects-26.9 may-affects-7.5 may-affects-8.1 may-affects-8.5 severity/major sig/execution type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
contribution first-time-contributor
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 84/100
-
enhancement needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
kind/cleanup
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
kubernetes-sigs/kueue#15947 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
sympozium-ai/sympozium#627 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100