fix(client): execute web workers concurrently
This commit is contained in:
committed by
mrugesh mohapatra
parent
e8f5b54d63
commit
845b966bda
@ -333,13 +333,13 @@ async function createTestRunnerForJSChallenge({ files }, solution) {
|
||||
const { build, sources } = await buildJSChallenge({ files });
|
||||
const code = sources && 'index' in sources ? sources['index'] : '';
|
||||
|
||||
const testWorker = createWorker('test-evaluator');
|
||||
const testWorker = createWorker('test-evaluator', { terminateWorker: true });
|
||||
return async ({ text, testString }) => {
|
||||
try {
|
||||
const { pass, err } = await testWorker.execute(
|
||||
{ testString, build, code, sources },
|
||||
5000
|
||||
);
|
||||
).done;
|
||||
if (!pass) {
|
||||
throw new AssertionError(`${text}\n${err.message}`);
|
||||
}
|
||||
@ -348,8 +348,6 @@ async function createTestRunnerForJSChallenge({ files }, solution) {
|
||||
? `${text}\n${err}`
|
||||
: (err.message = `${text}
|
||||
${err.message}`);
|
||||
} finally {
|
||||
testWorker.killWorker();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user