Skip to content

Commit cb1ffd4

Browse files
committed
add working timeouts
1 parent be0c1bb commit cb1ffd4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

deobfuscator-impl/src/test/java/uwu/narumi/deobfuscator/base/TestDeobfuscationBase.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.junit.jupiter.api.DisplayName;
1212
import org.junit.jupiter.api.DynamicTest;
1313
import org.junit.jupiter.api.TestFactory;
14-
import org.junit.jupiter.api.Timeout;
1514
import org.opentest4j.TestAbortedException;
1615
import uwu.narumi.deobfuscator.Deobfuscator;
1716
import uwu.narumi.deobfuscator.api.context.DeobfuscatorOptions;
@@ -20,12 +19,14 @@
2019

2120
import java.nio.file.Files;
2221
import java.nio.file.Path;
22+
import java.time.Duration;
2323
import java.util.ArrayList;
2424
import java.util.List;
2525
import java.util.function.Supplier;
2626
import java.util.stream.Stream;
2727

28-
@Timeout(60)
28+
import static org.junit.jupiter.api.Assertions.*;
29+
2930
public abstract class TestDeobfuscationBase {
3031
public static final Path TEST_DATA_PATH = Path.of("..", "testData");
3132
public static final Path COMPILED_PATH = TEST_DATA_PATH.resolve("compiled");
@@ -73,7 +74,8 @@ public record RegisteredTest(
7374
* Build test
7475
*/
7576
public DynamicTest buildTest() {
76-
return DynamicTest.dynamicTest(this.testName, this::runTest);
77+
return DynamicTest.dynamicTest(this.testName,
78+
() -> assertTimeoutPreemptively(Duration.ofSeconds(300), this::runTest));
7779
}
7880

7981
/**

0 commit comments

Comments
 (0)