Skip to content

Commit

Permalink
test/wip: sleep before attempting to read
Browse files Browse the repository at this point in the history
  • Loading branch information
bogovicj committed Sep 24, 2024
1 parent 2c3c6e1 commit 6fc4c66
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 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 @@ -163,7 +163,7 @@ public void testReadWriteParse() throws InterruptedException
final String dataset = datasetBase;

singleReadWriteParseTest( imp, n5RootPath, dataset, blockSizeString, metatype, compressionString, true );
Thread.sleep(50);
Thread.sleep(25);
}
}
}
Expand Down Expand Up @@ -256,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 @@ -269,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 @@ -293,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 All @@ -308,8 +309,7 @@ else if (metadataType.equals(N5Importer.MetadataOmeZarrKey) || metadataType.equa
assertEquals( String.format( "%s resolutions y", dataset ), imp.getCalibration().pixelHeight, impRead.getCalibration().pixelHeight, EPS );
assertEquals( String.format( "%s resolutions z", dataset ), imp.getCalibration().pixelDepth, impRead.getCalibration().pixelDepth, EPS );

final boolean unitsEqual = impRead.getCalibration().getUnit().equals( imp.getCalibration().getUnit() );
assertTrue( String.format( "%s units ", dataset ), unitsEqual );
final boolean unitsEqual = impRead.getCalibration().getUnit().equals( imp.getCalibration().getUnit() ); assertTrue( String.format( "%s units ", dataset ), unitsEqual );
}

if( testData )
Expand All @@ -327,11 +327,11 @@ else if (metadataType.equals(N5Importer.MetadataOmeZarrKey) || metadataType.equa
}

impRead.close();
// deleteContainer(outputPath);
deleteContainer(outputPath);
}

@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 Down Expand Up @@ -605,7 +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(50);
Thread.sleep(25);
}
}
}
Expand Down

0 comments on commit 6fc4c66

Please sign in to comment.