Browse Source

Add cancellation detection.

master
t123yh 7 years ago
parent
commit
8495c21f74
  1. 3
      src/runner/judge.ts

3
src/runner/judge.ts

@ -326,6 +326,9 @@ export async function judgeInteraction(task: InteractionRunTask)
} else if (runResult.result.status === SandboxStatus.RuntimeError) { } else if (runResult.result.status === SandboxStatus.RuntimeError) {
message = `Killed: ${signals[runResult.result.code]}`; message = `Killed: ${signals[runResult.result.code]}`;
status = TestcaseResultType.RuntimeError; 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) { } else if (runResult.result.status !== SandboxStatus.OK) {
message = "Warning: corrupt sandbox result " + util.inspect(runResult.result); message = "Warning: corrupt sandbox result " + util.inspect(runResult.result);
status = TestcaseResultType.RuntimeError; status = TestcaseResultType.RuntimeError;

Loading…
Cancel
Save