test(execution): cover context top-level await - #1956
NathanFlurry merged 1 commit into
Conversation
|
Stack for rivet-dev/agentos
Get stack: change zznlqovp |
9807101 to
ae61189
Compare
Add a wire-level native-sidecar test that an inline format=Module JavaScript source using top-level await in a named context settles and exits Succeeded/0. Ports #1956 onto main; depends on the inline module format fix from #1949 and fails without it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
f8a089c to
8d731b2
Compare
| wire::RequestPayload::JavaScriptExecutionRequest(wire::JavaScriptExecutionRequest { | ||
| process: context_process_options("module-context"), | ||
| source: String::from( | ||
| "const value = await Promise.resolve(42);\n\ |
There was a problem hiding this comment.
🟠 Medium · The test never exercises pending top-level await
Promise.resolve(42) settles during the unconditional microtask checkpoint in execute_module, before the runtime checks the module-evaluation promise. Consequently this case never enters set_pending_module_evaluation or the session event-loop wait path, so an implementation that stops waiting for genuinely asynchronous top-level await would still pass. Use a promise that remains pending past the first checkpoint (for example a timer- or bridge-driven promise) and assert an effect produced after that await.
No description provided.