[wasm][nodejs] Ensure that stdout/stderr have been flushed out before exiting (#70416)
When the results xml is large, and we are writing the base64 representation in one line, `node` can exit before all the output gets flushed out. This results in xharness getting an incomplete `STARTRESULTXML <len> <base64> ... ` with missing `ENDRESULTXML`, thus no `testResults.xml` is generated. This can be seen in the case of `Microsoft.Extensions.Primitives.Tests` which has xml ~140KB, and `System.Memory.Tests` which has a xml ~13MB. So, wait for the two streams to be flushed out, with a timeout of 3secs. - use the `drain` event only if `stream.write('')` returns `false` * Address review feedback @kg, @maraf
Showing
想要评论请 注册 或 登录