We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See title.
package net.haspamelodica.aresexperiments.tests; import static org.junit.jupiter.api.Assertions.assertEquals; import de.tum.in.test.api.ActivateHiddenBefore; import de.tum.in.test.api.AllowThreads; import de.tum.in.test.api.BlacklistPath; import de.tum.in.test.api.Deadline; import de.tum.in.test.api.MirrorOutput; import de.tum.in.test.api.PathType; import de.tum.in.test.api.StrictTimeout; import de.tum.in.test.api.WhitelistPath; import de.tum.in.test.api.jupiter.PublicTest; import net.haspamelodica.aresexperiments.ExampleTestee; @MirrorOutput @StrictTimeout(10000) @Deadline("2021-11-15 05:30 Europe/Berlin") @ActivateHiddenBefore("2021-11-05 16:30 Europe/Berlin") //@WhitelistPath(value = "../pgdp2122*w03h01**", type = PathType.GLOB) // for manual assessment and development @WhitelistPath("target") // mainly for Artemis @BlacklistPath(value = "{src,target}**Test*.{java,class}", type = PathType.GLOB) @AllowThreads public class ExampleTest { @PublicTest public void insecureTest() { assertEquals(1337, new ExampleTestee().getSecretNumber()); } }
package net.haspamelodica.aresexperiments; public class ExampleTestee { public long getSecretNumber() { //System.out.println("some output"); Thread thread = new Thread(() -> System.out.println("asdf")); thread.start(); try { thread.join(); } catch(InterruptedException e) { throw new RuntimeException(e); } return 123; } }
This also happens from the CommonPool and crashes regardless of AllowThreads:
package net.haspamelodica.aresexperiments.tests; import static org.junit.jupiter.api.Assertions.assertEquals; import de.tum.in.test.api.ActivateHiddenBefore; import de.tum.in.test.api.BlacklistPath; import de.tum.in.test.api.Deadline; import de.tum.in.test.api.MirrorOutput; import de.tum.in.test.api.PathType; import de.tum.in.test.api.StrictTimeout; import de.tum.in.test.api.WhitelistPath; import de.tum.in.test.api.jupiter.PublicTest; import net.haspamelodica.aresexperiments.ExampleTestee; @MirrorOutput @StrictTimeout(10000) @Deadline("2021-11-15 05:30 Europe/Berlin") @ActivateHiddenBefore("2021-11-05 16:30 Europe/Berlin") //@WhitelistPath(value = "../pgdp2122*w03h01**", type = PathType.GLOB) // for manual assessment and development @WhitelistPath("target") // mainly for Artemis @BlacklistPath(value = "{src,target}**Test*.{java,class}", type = PathType.GLOB) public class ExampleTest { @PublicTest public void insecureTest() { assertEquals(1337, new ExampleTestee().getSecretNumber()); } }
package net.haspamelodica.aresexperiments; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.IntStream; public class ExampleTestee { public long getSecretNumber() { //System.out.println("some output"); Thread forbiddenThread = Thread.currentThread(); AtomicBoolean firstOtherThread = new AtomicBoolean(true); IntStream .range(0, 100) .parallel() .forEach(i -> { if(Thread.currentThread() == forbiddenThread) return; if(!firstOtherThread.getAndSet(false)) return; System.out.println("sysout from other thread"); }); return 123; } }
The text was updated successfully, but these errors were encountered:
The core exception is thrown in OutputTester#acceptOutput line 56
Sorry, something went wrong.
Probably something related to the lambda creation, not visible in the Java sources.
No branches or pull requests
See title.
PoC with plain threads
This also happens from the CommonPool and crashes regardless of AllowThreads:
PoC with CommonPool
The text was updated successfully, but these errors were encountered: