From 8495c21f742882fc5597720c9c26dbbfe1a9eeaf Mon Sep 17 00:00:00 2001 From: t123yh Date: Mon, 28 Aug 2017 21:42:25 +0800 Subject: [PATCH] Add cancellation detection. --- src/runner/judge.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runner/judge.ts b/src/runner/judge.ts index cd3ded5..c01bfe8 100644 --- a/src/runner/judge.ts +++ b/src/runner/judge.ts @@ -326,6 +326,9 @@ export async function judgeInteraction(task: InteractionRunTask) } else if (runResult.result.status === SandboxStatus.RuntimeError) { message = `Killed: ${signals[runResult.result.code]}`; status = TestcaseResultType.RuntimeError; + } else if (runResult.result.status === SandboxStatus.Cancelled) { + // User program is cancelled because the interactor has already exited. + // We do nothing here. } else if (runResult.result.status !== SandboxStatus.OK) { message = "Warning: corrupt sandbox result " + util.inspect(runResult.result); status = TestcaseResultType.RuntimeError;