File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
src/test/java/org/truffleruby Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 12
12
import static org .junit .Assert .assertEquals ;
13
13
import static org .junit .Assert .assertNotEquals ;
14
14
import static org .junit .Assert .assertTrue ;
15
- import static org .junit .Assert .fail ;
16
15
17
16
import org .graalvm .polyglot .Context ;
18
17
import org .graalvm .polyglot .PolyglotException ;
@@ -53,13 +52,17 @@ public void timeoutExecution() throws Throwable {
53
52
Thread .sleep (1000 );
54
53
context .close (true );
55
54
} catch (InterruptedException e ) {
56
- e .printStackTrace ();
57
- fail ();
55
+ throw new Error (e );
58
56
} catch (PolyglotException e ) {
59
- assertTrue (e .isCancelled ());
57
+ if (e .isCancelled ()) {
58
+ assertTrue (e .isCancelled ());
59
+ } else {
60
+ throw e ;
61
+ }
60
62
}
61
63
});
62
64
65
+ context .eval ("ruby" , "init = 1" );
63
66
thread .start ();
64
67
try {
65
68
String maliciousCode = "while true; end" ;
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public TestingThread(Runnable runnable) {
21
21
runnable .run ();
22
22
} catch (Throwable t ) {
23
23
throwable = t ;
24
+ throw t ;
24
25
}
25
26
});
26
27
}
You can’t perform that action at this time.
0 commit comments