[test] Add controller tests for mark_clearing functionality - #149
Conversation
Add comprehensive controller-side tests for the mark_clearing method introduced in PR Ascend#141. Tests verify the three-step clear protocol prevents stale reads and handles edge cases gracefully. - test_controller_mark_clearing: verifies mark_clearing prevents consumers from fetching samples pending deletion - test_controller_mark_clearing_idempotent: tests robustness with non-existent partitions, partial indexes, and multi-partition cases Signed-off-by: dodatboii <zhangyixiang9@huawei.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 399ef988d2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| fetch_meta = ray.get( | ||
| tq_controller.get_metadata.remote( | ||
| data_fields=data_fields, | ||
| batch_size=gbs * num_n_samples, |
There was a problem hiding this comment.
Request only the ready samples
With the default TransferQueueController.remote() (polling_mode=False), after mark_clearing only indexes 4-7 remain ready, but this fetch asks for 8 samples. get_metadata(..., mode="fetch") waits until enough samples are ready and then raises TimeoutError, so the new test fails before reaching the assertion; request 4 samples to exercise the intended stale-read check.
AGENTS.md reference: AGENTS.md:L32-L33
Useful? React with 👍 / 👎.
Signed-off-by: dodatboii <zhangyixiang9@huawei.com>
CLA Signature Passdodatboii, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
CLA Signature Passdodatboii, thanks for your pull request. All authors of the commits have signed the CLA. 👍 |
Add comprehensive controller-side tests for the mark_clearing method introduced in PR #141. Tests verify the three-step clear protocol prevents stale reads and handles edge cases gracefully.