Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Yicheng-Lu-llll
Copy link
Member

Description

In test_cancel_recursive_tree, the concurrent test case:

  1. Creates 10 ChildActor instances
  2. Submits 10 Actor.run tasks, each spawning child tasks on a ChildActor
  3. Cancels 5 tasks with recursive=True and 5 with recursive=False
  4. Expects that for recursive=True, both the parent task and child tasks are cancelled; for recursive=False, only the parent task is cancelled

The issue is in the verification loop: when checking if the parent tasks are cancelled, the test uses run_ref (a stale loop variable from the previous loop) instead of run_refs[i]. This causes the test to verify the same task (run_refs[9]) ten times, rather than verifying all 10 tasks.

This PR fixes the issue by using run_refs[i] to correctly verify each task.

Related issues

Link related issues: "Fixes #1234", "Closes #1234", or "Related to #1234".

Additional information

Optional: Add implementation details, API changes, usage examples, screenshots, etc.

@Yicheng-Lu-llll Yicheng-Lu-llll requested a review from a team as a code owner December 19, 2025 10:43
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request correctly fixes a bug in the test_cancel_recursive_tree test. The original code used a stale loop variable, which led to incorrect test verification. The submitted change replaces it with the correct reference, ensuring that all tasks are properly checked. The fix is accurate, minimal, and improves the reliability of the test suite. The change looks good to me.

@Yicheng-Lu-llll Yicheng-Lu-llll added the go add ONLY when ready to merge, run all tests label Dec 19, 2025
@ray-gardener ray-gardener bot added the core Issues that should be addressed in Ray Core label Dec 19, 2025
@edoakes edoakes merged commit 388d4b7 into ray-project:master Dec 19, 2025
5 of 6 checks passed
@Yicheng-Lu-llll
Copy link
Member Author

@edoakes Thank you!

Yicheng-Lu-llll added a commit to Yicheng-Lu-llll/ray that referenced this pull request Dec 22, 2025
…ification loop (ray-project#59574)

## Description

In test_cancel_recursive_tree, the concurrent test case:
1. Creates 10 ChildActor instances
2. Submits 10 Actor.run tasks, each spawning child tasks on a ChildActor
3. Cancels 5 tasks with recursive=True and 5 with recursive=False
4. Expects that for recursive=True, both the parent task and child tasks
are cancelled; for recursive=False, only the parent task is cancelled

The issue is in the verification loop: when checking if the parent tasks
are cancelled, the test uses `run_ref` (a stale loop variable from the
previous loop) instead of run_refs[i]. This causes the test to verify
the same task (`run_refs[9]`) ten times, rather than verifying all 10
tasks.

This PR fixes the issue by using `run_refs[i]` to correctly verify each
task.

## Related issues
> Link related issues: "Fixes ray-project#1234", "Closes ray-project#1234", or "Related to
ray-project#1234".

## Additional information
> Optional: Add implementation details, API changes, usage examples,
screenshots, etc.

Signed-off-by: yicheng <[email protected]>
Co-authored-by: yicheng <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Issues that should be addressed in Ray Core go add ONLY when ready to merge, run all tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ray fails to serialize self-reference objects

2 participants