Skip to content

Commit dd989d4

Browse files
committed
make timeout test a bit better
1 parent 266f277 commit dd989d4

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/Solution.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public static void main(String... args) {
55
if (line.contains("w")) { // Invalid output
66
System.out.println(line);
77
} else if (line.contains("2")) { // Timeout
8-
while (true);
8+
while (true) Thread.sleep(10_000); // Shouldn't take more than 10s, but if it does, then loop.
99
} else { // correct output
1010
char[] chars = line.toCharArray();
1111
for (int i = 0; i < chars.length / 2; ++i) {

tests/java.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ async fn java_success() -> Result<(), Box<dyn Error>> {
2323
.run_command(["java", "Solution"])
2424
.rules(rules)
2525
.max_memory(MemorySize::from_mb(800))
26-
.timeout(Duration::from_secs(5))
26+
.timeout(Duration::from_secs(3))
2727
.trim_output(true)
2828
.build();
2929

0 commit comments

Comments
 (0)