Skip to content

test(execution): cover context top-level await - #1956

Merged
NathanFlurry merged 1 commit into
mainfrom
stack/test-execution-cover-context-top-level-await-zznlqovp
Sep 17, 2026
Merged

NathanFlurry merged 1 commit into
mainfrom
stack/test-execution-cover-context-top-level-await-zznlqovp

Conversation

@NathanFlurry

Copy link
Copy Markdown
Member

No description provided.

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>
@NathanFlurry
NathanFlurry force-pushed the stack/test-execution-cover-context-top-level-await-zznlqovp branch from f8a089c to 8d731b2 Compare September 17, 2026 02:55

@the-company-company the-company-company 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.

🟠 1 medium-severity finding

Reviewed commit 8d731b2.

wire::RequestPayload::JavaScriptExecutionRequest(wire::JavaScriptExecutionRequest {
process: context_process_options("module-context"),
source: String::from(
"const value = await Promise.resolve(42);\n\

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟠 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.

@NathanFlurry
NathanFlurry merged commit 9207f66 into main Sep 17, 2026
8 of 9 checks passed
@NathanFlurry
NathanFlurry deleted the stack/test-execution-cover-context-top-level-await-zznlqovp branch September 17, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant