HS test runner: unwrap value handles in io-wait-event interceptor
Some checks are pending
Test, Build, and Deploy / test-build-deploy (push) Waiting to run

The new WASM ABI wraps numbers, strings, and other atoms as opaque
value-handles ({_type, __sx_handle}) inside the perform request args.
The io-wait-event mock checks typeof against 'number' and 'string'
directly, so under the new ABI:

  - typeof timeout === 'number'  →  false  (timeout is a handle)
  - typeof items[2] === 'string' →  false  (event name is a handle)

so the "timeout wins" branch never triggered, and the test fell into
the "neither timeout nor event" else that resumed with nil but never
fired the post-wait `then add .bar` command.

Apply _unwrapHandle to the three args (target, evName, timeout) before
the type checks. This is the same pattern the rest of the host-* native
sweep already follows (commit 29ef89d4).

Effect: hs-upstream-wait goes from 5/7 → 7/7.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-12 21:33:24 +00:00
parent 4d92eafb36
commit cfbab3b2f9

View File

@@ -885,9 +885,11 @@ globalThis._driveAsync=function driveAsync(r,d){d=d||0;if(_testDeadline && Date.
else if(opName==='io-parse-html'){const resp=items&&items[1];const htmlStr=resp&&(resp._html||resp._body)?String(resp._html||resp._body):'';const frag=new El('fragment');frag.nodeType=11;if(htmlStr)frag._setInnerHTML(htmlStr);doResume(frag);} else if(opName==='io-parse-html'){const resp=items&&items[1];const htmlStr=resp&&(resp._html||resp._body)?String(resp._html||resp._body):'';const frag=new El('fragment');frag.nodeType=11;if(htmlStr)frag._setInnerHTML(htmlStr);doResume(frag);}
else if(opName==='io-settle')doResume(null); else if(opName==='io-settle')doResume(null);
else if(opName==='io-wait-event'){ else if(opName==='io-wait-event'){
const target=items&&items[1]; const target=_unwrapHandle(items&&items[1]);
const evName=typeof items[2]==='string'?items[2]:''; const evNameRaw=_unwrapHandle(items&&items[2]);
const timeout=items&&items.length>3?items[3]:undefined; const evName=typeof evNameRaw==='string'?evNameRaw:'';
const timeoutRaw=items&&items.length>3?_unwrapHandle(items[3]):undefined;
const timeout=typeof timeoutRaw==='number'?timeoutRaw:undefined;
if(typeof timeout==='number'){ if(typeof timeout==='number'){
// `wait for EV or Nms` — timeout wins immediately in the mock (tests use 0ms) // `wait for EV or Nms` — timeout wins immediately in the mock (tests use 0ms)
doResume(null); doResume(null);