Skip to content

[test] Add controller tests for mark_clearing functionality - #149

Merged
0oshowero0 merged 2 commits into
Ascend:mainfrom
dodatboii:add_controller_tests
Aug 12, 2026
Merged

[test] Add controller tests for mark_clearing functionality#149
0oshowero0 merged 2 commits into
Ascend:mainfrom
dodatboii:add_controller_tests

Conversation

@dodatboii

Copy link
Copy Markdown
Contributor

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.

  • 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

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>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread tests/test_controller.py Outdated
fetch_meta = ray.get(
tq_controller.get_metadata.remote(
data_fields=data_fields,
batch_size=gbs * num_n_samples,

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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>
@0oshowero0
0oshowero0 merged commit 2884118 into Ascend:main Aug 12, 2026
8 checks passed
@ascend-robot

Copy link
Copy Markdown

CLA Signature Pass

dodatboii, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@ascend-robot

Copy link
Copy Markdown

CLA Signature Pass

dodatboii, thanks for your pull request. All authors of the commits have signed the CLA. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants