Skip to content

Commit

Permalink
Add timeout to h5dump tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmudd committed May 11, 2024
1 parent a7e479f commit 84c2eac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion jhdf/src/test/java/io/jhdf/h5dump/H5Dump.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Path;
import java.util.concurrent.TimeUnit;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.blankOrNullString;
Expand All @@ -48,7 +49,7 @@ public static HDF5FileXml dumpAndParse(Path path) throws IOException, Interrupte
processBuilder.command("h5dump", "--format=%.1lf", "--xml", path.toAbsolutePath().toString());
processBuilder.redirectErrorStream(true); // get stderr as well
Process process = processBuilder.start();
process.waitFor();
process.waitFor(30, TimeUnit.SECONDS);
String xmlString = IOUtils.toString(process.getInputStream(), StandardCharsets.UTF_8);
logger.info("h5dump return [{}] output [{}]", process.exitValue(), xmlString);
// Validate
Expand Down

0 comments on commit 84c2eac

Please sign in to comment.