From e2b357bb56b7a8d9935c8e13a57fe6d6355a71a6 Mon Sep 17 00:00:00 2001 From: Oliver Eyton-Williams Date: Sat, 4 Jan 2020 06:08:05 +0100 Subject: [PATCH] fix: flush logs straight after evaluation (#38011) If test evaluation takes too long the worker can timeout and any logs will be lost. Flushing the logs before test evaluation avoids this. --- client/src/client/workers/test-evaluator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/src/client/workers/test-evaluator.js b/client/src/client/workers/test-evaluator.js index 5869047b52..f08af9fe2f 100644 --- a/client/src/client/workers/test-evaluator.js +++ b/client/src/client/workers/test-evaluator.js @@ -47,7 +47,8 @@ const __utils = (() => { return { postResult, log, - toggleProxyLogger + toggleProxyLogger, + flushLogs }; })(); @@ -71,6 +72,7 @@ self.onmessage = async e => { // generated during testing. testResult = eval(` ${e.data.build} + __utils.flushLogs(); __userCodeWasExecuted = true; __utils.toggleProxyLogger(true); ${e.data.testString}