This is an automated email from the ASF dual-hosted git repository.
baunsgaard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git
The following commit(s) were added to refs/heads/main by this push:
new 96c620674f [MINOR] Write compressed test fix
96c620674f is described below
commit 96c620674f285a13d8f91f82750841b6fb15e74d
Author: Sebastian Baunsgaard <[email protected]>
AuthorDate: Sat Dec 30 13:02:40 2023 +0100
[MINOR] Write compressed test fix
This commit solidify the already working compression test
to be more resilient in the GitHub Actions.
Closes #1966
---
.../sysds/test/component/compress/io/IOTest.java | 28 ++++------------------
1 file changed, 5 insertions(+), 23 deletions(-)
diff --git
a/src/test/java/org/apache/sysds/test/component/compress/io/IOTest.java
b/src/test/java/org/apache/sysds/test/component/compress/io/IOTest.java
index 3708b52e7d..3c18cf049b 100644
--- a/src/test/java/org/apache/sysds/test/component/compress/io/IOTest.java
+++ b/src/test/java/org/apache/sysds/test/component/compress/io/IOTest.java
@@ -134,26 +134,7 @@ public class IOTest {
}
protected static void writeAndReadR(MatrixBlock mb, int rep) throws
Exception {
- try {
-
- String filename = getName();
- WriterCompressed.writeCompressedMatrixToHDFS(mb,
filename);
- File f = new File(filename);
- assertTrue(f.isFile() || f.isDirectory());
- MatrixBlock mbr = IOCompressionTestUtils.read(filename,
mb.getNumRows(), mb.getNumColumns(),
- OptimizerUtils.DEFAULT_BLOCKSIZE);
- IOCompressionTestUtils.verifyEquivalence(mb, mbr);
- }
- catch(Exception e) {
- if(rep < 3) {
- Thread.sleep(1000);
- writeAndReadR(mb, rep + 1);
- return;
- }
- e.printStackTrace();
- fail("Failed to write file");
- }
-
+ writeAndReadR(mb, OptimizerUtils.DEFAULT_BLOCKSIZE, rep);
}
protected static void write(MatrixBlock src, String path) throws
Exception {
@@ -177,11 +158,12 @@ public class IOTest {
protected static void writeAndReadR(MatrixBlock mb, int blen, int rep)
throws Exception {
try {
-
String filename = getName();
- WriterCompressed.writeCompressedMatrixToHDFS(mb,
filename, blen);
File f = new File(filename);
- assertTrue(f.isFile() || f.isDirectory());
+ f.delete();
+ WriterCompressed.writeCompressedMatrixToHDFS(mb,
filename, blen);
+ File f2 = new File(filename);
+ assertTrue(f2.isFile() || f2.isDirectory());
MatrixBlock mbr = IOCompressionTestUtils.read(filename,
mb.getNumRows(), mb.getNumColumns(), blen);
IOCompressionTestUtils.verifyEquivalence(mb, mbr);
}