Enforce script timeout in Hyperlight runner#351
Merged
Conversation
Use hyperlight-unikraft v0.6.0 which adds run_code_with_timeout() with cancellable host sleep. When script_timeout is set in the config, the runner uses the timeout variant; otherwise run_code() is used as before. Signed-off-by: danbugs <danilochiarlone@gmail.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR adds support for enforcing script execution timeouts in the Hyperlight runner and introduces an E2E test case/config to validate timeout behavior, alongside a dependency bump for the Hyperlight Unikraft host.
Changes:
- Add timeout-aware execution path in
HyperlightScriptRunnerusingrun_code_with_timeout. - Add a new Hyperlight E2E test case + config that should time out.
- Bump
hyperlight-unikraft-hostdependency fromv0.5.0tov0.6.0.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| test_configs/hyperlight_timeout.json | Adds a config intended to force a timeout scenario for Hyperlight runs. |
| src/wxc_e2e_tests/tests/e2e_windows.rs | Adds a Windows E2E test case asserting the timeout behavior/output. |
| src/wxc_common/src/hyperlight_runner.rs | Implements timeout-aware execution via run_code_with_timeout when configured. |
| src/wxc_common/Cargo.toml | Updates Hyperlight Unikraft host dependency tag to a newer version. |
Signed-off-by: danbugs <danilochiarlone@gmail.com>
Signed-off-by: danbugs <danilochiarlone@gmail.com>
Signed-off-by: danbugs <danilochiarlone@gmail.com>
huzaifa-d
approved these changes
May 21, 2026
| { | ||
| "process": { | ||
| "commandLine": "import time; time.sleep(120); print('should not reach here')", | ||
| "timeout": 1000 |
Contributor
There was a problem hiding this comment.
Can't this timeout for the first cold launch?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_code_with_timeout()with cancellable host sleepscript_timeoutis set in the config, the Hyperlight runner uses the timeout variant to kill long-running or sleeping guest code promptly; otherwiserun_code()is used as beforehyperlight_timeout.jsontest config and e2e test case (time.sleep(120)killed by 5s timeout)Microsoft Reviewers: Open in CodeFlow