Skip to content

Commit

Permalink
Revert "test/wip: try removing sleeps again"
Browse files Browse the repository at this point in the history
This reverts commit 061ec4b.
  • Loading branch information
bogovicj committed Sep 25, 2024
1 parent 061ec4b commit cd18cf8
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions src/test/java/org/janelia/saalfeldlab/n5/TestExportImports.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private static boolean deleteContainer(final String rootPath) {
}

@Test
public void testEmptyMeta()
public void testEmptyMeta() throws InterruptedException
{
final ImagePlus imp = NewImage.createImage("test", 8, 6, 2, 16, NewImage.FILL_NOISE);
final String metaType = N5Importer.MetadataDefaultKey;
Expand Down Expand Up @@ -133,7 +133,7 @@ public void test4dN5v()
}

@Test
public void testReadWriteParse()
public void testReadWriteParse() throws InterruptedException
{
final HashMap<String,String> typeToExtension = new HashMap<>();
typeToExtension.put( "FILESYSTEM", "n5" );
Expand Down Expand Up @@ -163,6 +163,7 @@ public void testReadWriteParse()
final String dataset = datasetBase;

singleReadWriteParseTest( imp, n5RootPath, dataset, blockSizeString, metatype, compressionString, true );
Thread.sleep(25);
}
}
}
Expand Down Expand Up @@ -255,7 +256,7 @@ public void singleReadWriteParseTest(
final String blockSizeString,
final String metadataType,
final String compressionType,
final boolean testMeta )
final boolean testMeta ) throws InterruptedException
{
singleReadWriteParseTest( imp, outputPath, dataset, blockSizeString, metadataType, compressionType, testMeta, true);
}
Expand All @@ -268,7 +269,7 @@ public static void singleReadWriteParseTest(
final String metadataType,
final String compressionType,
final boolean testMeta,
final boolean testData )
final boolean testData ) throws InterruptedException
{
final N5ScalePyramidExporter writer = new N5ScalePyramidExporter();
writer.setOptions( imp, outputPath, dataset, N5ScalePyramidExporter.AUTO_FORMAT, blockSizeString, false,
Expand All @@ -292,6 +293,7 @@ else if (metadataType.equals(N5Importer.MetadataOmeZarrKey) || metadataType.equa
else
assertTrue("n5 or zarr root is not a directory:" + outputPath, n5RootWritten.isDirectory());

Thread.sleep(25);
final N5Importer reader = new N5Importer();
reader.setShow( false );
final List< ImagePlus > impList = reader.process( n5PathAndDataset, false );
Expand Down Expand Up @@ -329,7 +331,7 @@ else if (metadataType.equals(N5Importer.MetadataOmeZarrKey) || metadataType.equa
}

@Test
public void testRgb()
public void testRgb() throws InterruptedException
{
final ImagePlus imp = NewImage.createRGBImage("test", 8, 6, 4, NewImage.FILL_NOISE);
final String metaType = N5Importer.MetadataImageJKey;
Expand All @@ -352,10 +354,14 @@ public void testMultiChannel()
{
for( final String suffix : new String[] { ".h5", ".n5", ".zarr" })
{
testMultiChannelHelper(N5Importer.MetadataN5ViewerKey, suffix);
testMultiChannelHelper(N5Importer.MetadataN5CosemKey, suffix);
testMultiChannelHelper(N5Importer.MetadataOmeZarrKey, suffix);
testMultiChannelHelper(N5Importer.MetadataImageJKey, suffix);
try {
testMultiChannelHelper(N5Importer.MetadataN5ViewerKey, suffix);
testMultiChannelHelper(N5Importer.MetadataN5CosemKey, suffix);
testMultiChannelHelper(N5Importer.MetadataOmeZarrKey, suffix);
testMultiChannelHelper(N5Importer.MetadataImageJKey, suffix);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}

Expand Down Expand Up @@ -569,7 +575,7 @@ public void reset() {

}

public void testMultiChannelHelper( final String metatype, final String suffix )
public void testMultiChannelHelper( final String metatype, final String suffix ) throws InterruptedException
{
final int bitDepth = 8;
final String blockSizeString = "16";
Expand Down Expand Up @@ -599,6 +605,7 @@ public void testMultiChannelHelper( final String metatype, final String suffix )
final String n5RootPath = baseDir + "/test_" + metatype + "_" + dimCode + suffix;
final String dataset = String.format("/%s", dimCode);
singleReadWriteParseTest( imp, n5RootPath, dataset, blockSizeString, metatype, compressionString, true, nc == 1 );
Thread.sleep(25);
}
}
}
Expand Down

0 comments on commit cd18cf8

Please sign in to comment.