Python: stabilize Hyperlight output cleanup test - #8380
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The barrier correctly waits behind the queued cleanup task and removes the reported race without changing production behavior.
Pull request overview
Stabilizes the Hyperlight output-cleanup test by synchronizing with asynchronous sandbox cleanup.
Changes:
- Waits for the single cleanup executor to drain.
- Verifies the retired output directory no longer exists.
File summaries
| File | Description |
|---|---|
python/packages/hyperlight/tests/hyperlight/test_hyperlight_codeact.py |
Adds a deterministic cleanup barrier before asserting directory removal. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
MAF Automated Review — Iteration 1
Result: No findings
Scope: full PR (1 commit(s)): f46f60353c6c
Model: gpt-5.6-sol-fast
Overview
The PR replaces a racy directory listing with a FIFO barrier on the registry's single cleanup worker, then checks that the retired output directory is absent. The awaited invocation guarantees cleanup is queued before the barrier, and the assertion runs before registry teardown, so the test preserves the intended rejection and cleanup contract without introducing a publishable risk.
Reviewed the supplied pull-request change set across correctness, security/reliability, architecture, and failure behavior.
No publishable findings remained after source verification for this scope.
Motivation & Context
test_execute_code_tool_clears_output_after_rejectionraces background cleanup: rejecting an oversized output retires the sandbox entry and asynchronously deletes its temporary directory. If deletion finishes before the test lists that directory, the test raisesFileNotFoundError, as seen in this CI job.Description & Review Guide
Related Issue
None.
Contribution Checklist
breaking changelabel (or add "[BREAKING]" to the title prefix, before or after any language prefix) — a workflow keeps the label and title prefix in sync automatically.