|
3 | 3 | import static judgels.gabriel.api.Verdict.ACCEPTED;
|
4 | 4 | import static judgels.gabriel.api.Verdict.COMPILATION_ERROR;
|
5 | 5 | import static judgels.gabriel.api.Verdict.OK;
|
| 6 | +import static judgels.gabriel.api.Verdict.TIME_LIMIT_EXCEEDED; |
6 | 7 | import static judgels.gabriel.api.Verdict.WRONG_ANSWER;
|
7 | 8 | import static org.assertj.core.api.Assertions.assertThat;
|
8 | 9 | import static org.assertj.core.api.Assertions.assertThatThrownBy;
|
9 | 10 |
|
10 | 11 | import com.google.common.collect.ImmutableList;
|
11 | 12 | import com.google.common.collect.ImmutableSet;
|
12 | 13 | import java.util.List;
|
| 14 | +import java.util.Optional; |
13 | 15 | import judgels.gabriel.api.EvaluationException;
|
14 | 16 | import judgels.gabriel.api.GradingException;
|
15 | 17 | import judgels.gabriel.api.GradingResult;
|
16 | 18 | import judgels.gabriel.api.GradingResultDetails;
|
17 | 19 | import judgels.gabriel.api.PreparationException;
|
| 20 | +import judgels.gabriel.api.SandboxExecutionStatus; |
18 | 21 | import judgels.gabriel.api.TestCase;
|
19 | 22 | import judgels.gabriel.api.TestGroup;
|
20 | 23 | import judgels.gabriel.engines.BlackboxGradingEngineIntegrationTests;
|
@@ -114,6 +117,31 @@ void wa_90() throws GradingException {
|
114 | 117 | subtaskResult(-1, OK, 90)));
|
115 | 118 | }
|
116 | 119 |
|
| 120 | + @Test |
| 121 | + void tle_when_communication_timed_out() throws GradingException { |
| 122 | + addSourceFile("source", "trigger-communication-TLE.cpp"); |
| 123 | + assertResult( |
| 124 | + new InteractiveGradingConfig.Builder().from(CONFIG) |
| 125 | + .communicator("communicator-TLE.cpp").build(), |
| 126 | + TIME_LIMIT_EXCEEDED, |
| 127 | + 0, |
| 128 | + List.of( |
| 129 | + testGroupResult( |
| 130 | + 0, |
| 131 | + testCaseResult(TIME_LIMIT_EXCEEDED, "", Optional.of(SandboxExecutionStatus.TIMED_OUT), 0), |
| 132 | + testCaseResult(TIME_LIMIT_EXCEEDED, "", Optional.of(SandboxExecutionStatus.TIMED_OUT), 0), |
| 133 | + testCaseResult(TIME_LIMIT_EXCEEDED, "", Optional.of(SandboxExecutionStatus.TIMED_OUT), 0)), |
| 134 | + testGroupResult( |
| 135 | + -1, |
| 136 | + testCaseResult(TIME_LIMIT_EXCEEDED, "0.0", Optional.of(SandboxExecutionStatus.TIMED_OUT), -1), |
| 137 | + testCaseResult(TIME_LIMIT_EXCEEDED, "0.0", Optional.of(SandboxExecutionStatus.TIMED_OUT), -1), |
| 138 | + testCaseResult(TIME_LIMIT_EXCEEDED, "0.0", Optional.of(SandboxExecutionStatus.TIMED_OUT), -1), |
| 139 | + testCaseResult(TIME_LIMIT_EXCEEDED, "0.0", Optional.of(SandboxExecutionStatus.TIMED_OUT), -1), |
| 140 | + testCaseResult(TIME_LIMIT_EXCEEDED, "0.0", Optional.of(SandboxExecutionStatus.TIMED_OUT), -1))), |
| 141 | + List.of( |
| 142 | + subtaskResult(-1, TIME_LIMIT_EXCEEDED, 0))); |
| 143 | + } |
| 144 | + |
117 | 145 | @Test
|
118 | 146 | void ce() throws GradingException {
|
119 | 147 | addSourceFile("source", "binsearch-CE.cpp");
|
|
0 commit comments