diff options
| author | Cliff Click <cliffc@acm.org> | 2026-10-07 12:09:59 -0700 |
|---|---|---|
| committer | Cliff Click <cliffc@acm.org> | 2026-10-07 12:09:59 -0700 |
| commit | 625eb017062850e7827dddd8f3ce121e7fea1139 (patch) | |
| tree | 640398f1ac7f517e6a6bca517a0bce5979827743 | |
| parent | df5efaa0d05b3583eb6ca3b5f67df83827889e42 (diff) | |
| download | Simple-625eb017062850e7827dddd8f3ce121e7fea1139.tar.gz Simple-625eb017062850e7827dddd8f3ce121e7fea1139.zip | |
Fix CI timeout
| -rw-r--r-- | chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java b/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java index b06f90d8..32861bc9 100644 --- a/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java +++ b/chapter25/src/test/java/com/seaofnodes/simple/Chapter25Test.java @@ -18,7 +18,6 @@ import java.io.PrintStream; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.util.concurrent.TimeUnit; import org.junit.Ignore; import org.junit.Test; @@ -373,23 +372,14 @@ public class Chapter25Test { String obj = "build/objs/"+base+".o"; String exe = "build/objs/"+base+(TestC.OS.startsWith("Windows") ? ".exe" : ""); - String syms = run(new String[]{"nm",obj}); + String syms = TestC.exec("nm",obj); assertTrue(syms, syms.contains(" U sys.io.p_noInline")); TestC.linkExe(obj,null,null,new Ary<>(new String[]{SYS_FILE.toString()}),exe); - String rez = run(new String[]{exe}); + String rez = TestC.exec(exe); assertEquals(expected,rez); } - private static String run(String[] cmd) throws Exception { - Process p = new ProcessBuilder(cmd).redirectErrorStream(true).start(); - boolean normal = p.waitFor(5, TimeUnit.SECONDS); - String out = new String(p.getInputStream().readAllBytes()); - assertTrue(out, normal); - assertEquals(out,0,p.exitValue()); - return out; - } - @Test public void testRedirectedRead() throws IOException { String src = """ |
