remove serialization-stage secmgr to avoid spurious errors due to extra surefire thread

This commit is contained in:
Chris Frohoff
2018-11-15 13:17:25 -08:00
parent a1a40d239f
commit 4088b8cda2
3 changed files with 3 additions and 4 deletions
@@ -6,6 +6,7 @@ import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.Callable;
// TODO per-thread secmgr
public class ExecCheckingSecurityManager extends SecurityManager {
public ExecCheckingSecurityManager() {
this(true);
@@ -41,7 +42,6 @@ public class ExecCheckingSecurityManager extends SecurityManager {
}
};
@SuppressWarnings("serial")
public static class ExecException extends RuntimeException {
private final String threadName = Thread.currentThread().getName();
@@ -16,7 +16,6 @@ public class CommandExecTest implements CustomTest {
@Override
public void run(Callable<Object> payload) throws Exception {
Assert.assertFalse("test file should not exist", testFile.exists());
Exception err;
try {
payload.call();
} catch (Exception e) {
@@ -107,8 +107,8 @@ public class PayloadsTest {
customDeserializer = ((CustomDeserializer)testHarness).getCustomDeserializer();
}
ExecCheckingSecurityManager sm = new ExecCheckingSecurityManager();
final byte[] serialized = sm.callWrapped(makeSerializeCallable(payloadClass, payloadCommand));
// TODO per-thread secmgr to enforce no detonation during deserialization
final byte[] serialized = makeSerializeCallable(payloadClass, payloadCommand).call();
Callable<Object> callable = makeDeserializeCallable(t, addlClassesForClassLoader, deps, serialized, customDeserializer);
if ( testHarness instanceof WrappedTest ) {
callable = ( (WrappedTest) testHarness ).createCallable(callable);