Integration test helpers can mask timeout failures
assertWillComeTrue() currently awaits its predicate while polling, but the final assertion does not:
assert.ok(predicate())
Since the predicate returns a Promise<boolean>, the assertion checks the Promise object itself, which is truthy.
This means the normal happy path still works: if the predicate eventually becomes true, the polling loop exits normally. But if the predicate stays false until the timeout expires, the helper can incorrectly succeed instead of failing.
A focused regression test reproduces this with a predicate that always returns false:
- before the fix,
assertWillComeTrue()resolves instead of rejecting; - after changing the final assertion to
assert.ok(await predicate()), it fails as intended.
There is a second parameter-wiring issue in assertWorkspaceWillBeOpen():
assertWillComeTrue(predicate, timeout)
The second argument of assertWillComeTrue() is the polling interval, not the timeout. Therefore the default 10000 value becomes a 10-second polling interval while the actual timeout remains the default 300 seconds.
So the two issues can reinforce each other:
- workspace polling may continue for much longer than intended;
- if the real timeout is eventually reached, the final Promise assertion can still mask the failure.
Proposed fix:
- await the predicate in the final assertion;
- pass the workspace timeout in the third argument slot;
- add focused regression coverage for the timeout failure path;
- correct the stale
BITBAKE_TIMEOUTcomment:300000 msis 5 minutes, not 3.
A local RED/GREEN reproduction confirms the behavior:
- baseline: focused regression test fails because the expected rejection is missing;
- fixed helper: the same regression test passes.