Skip to content

Commit

Permalink
Merge pull request #424 from kusumotolab/remove-thread-timeout
Browse files Browse the repository at this point in the history
JUnitの余計なスレッドタイムアウト処理の削除
  • Loading branch information
YoshikiHigo authored Nov 16, 2018
2 parents e8f147a + b1cb449 commit 9ac20b1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import jp.kusumotolab.kgenprog.Configuration;
import jp.kusumotolab.kgenprog.project.GeneratedSourceCode;
import jp.kusumotolab.kgenprog.project.build.BuildResults;
Expand Down Expand Up @@ -34,16 +32,14 @@ public TestResults exec(final GeneratedSourceCode generatedSourceCode) {
final Future<?> future = executor.submit(testThread);
executor.shutdown();
try {
future.get(config.getTestTimeLimitSeconds(), TimeUnit.SECONDS);
future.get();
} catch (final ExecutionException e) {
// TODO Should handle safely
// Executor側での例外をそのまま通す.
e.printStackTrace();
} catch (final InterruptedException e) {
// TODO Should handle safely
e.printStackTrace();
} catch (final TimeoutException e) {
return EmptyTestResults.instance;
}

return testThread.getTestResults();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import org.junit.Ignore;
import org.junit.Test;
import jp.kusumotolab.kgenprog.Configuration;
import jp.kusumotolab.kgenprog.project.ASTLocation;
Expand Down Expand Up @@ -184,6 +185,9 @@ public void testExecWithRetrievingFLParametersWithInnerClass() throws Exception
assertThat(nf2).isEqualTo(1); // FooTest#test03
}

@Ignore
// #408 テスト打ち切り方針をJUnitアノテーションに変更したので,以下テストは成功しなくなった.
// JUnitアノテーションの差し込みは Variant 生成時に限るので,以下テストでは適切にタイムアウト処理が行われず無限ループとなる.
@Test
// 無限ループする題材の確認
public void testExecForInfiniteLoop() throws Exception {
Expand Down

0 comments on commit 9ac20b1

Please sign in to comment.