Change the ControlTransfersMultiThreadedStressTest's fakes to reply asynchronously from the main thread, instead of immediate synchronous replies.
This is better because it avoids reentrant recursive calls ("request1=>response1=>request2=>response2=>...") and excessive call stack usage from hundreds of nested calls. The latter is especially a problem in WebAssembly builds with debugging flags on.
In the real-world usages, this kind of reentrancy never happens because USB APIs are asynchronous.
The fix should unblock upreving to a more recent Emscripten version, as for some reason the stack usage grew in it and made the test very flaky without this fix.
Change the ControlTransfersMultiThreadedStressTest's fakes to reply asynchronously from the main thread, instead of immediate synchronous replies.
This is better because it avoids reentrant recursive calls ("request1=>response1=>request2=>response2=>...") and excessive call stack usage from hundreds of nested calls. The latter is especially a problem in WebAssembly builds with debugging flags on.
In the real-world usages, this kind of reentrancy never happens because USB APIs are asynchronous.
The fix should unblock upreving to a more recent Emscripten version, as for some reason the stack usage grew in it and made the test very flaky without this fix.