You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "sarutak (via GitHub)" <gi...@apache.org> on 2023/09/20 16:12:13 UTC

[GitHub] [avro] sarutak opened a new pull request, #2506: AVRO-3863: [Java] Delete temporary test data after tests finish

sarutak opened a new pull request, #2506:
URL: https://github.com/apache/avro/pull/2506

   AVRO-3863
   
   ## What is the purpose of the change
   This PR proposes to delete temporary test data generated by tests for Java SDK.
   Tests for Java SDK creates some test data, which are left even after tests finish.
   ```
   ls -1 /tmp/*.avro
   /tmp/junit1533190586260098046testMappedByteBuffer.avro
   /tmp/junit3099644739767498712testMappedByteBuffer.avro
   /tmp/junit4466003251314064556testMappedByteBuffer.avro
   /tmp/junit4974226498248565286testMappedByteBuffer.avro
   /tmp/junit6473921034404349045testMappedByteBuffer.avro
   /tmp/junit8662732084083941415testMappedByteBuffer.avro
   /tmp/random.avro
   /tmp/testIgnoreSchemaValidationOnRead275054571669736256.avro
   /tmp/testIgnoreSchemaValidationOnRead4615547521362396523.avro
   /tmp/testIgnoreSchemaValidationOnRead4955268403025511495.avro
   /tmp/testIgnoreSchemaValidationOnRead5426593551205571746.avro
   /tmp/testIgnoreSchemaValidationOnRead7554021276748093417.avro
   /tmp/testIgnoreSchemaValidationOnRead8241302423385070851.avro
   /tmp/testInputStreamEOF3549506421974960237.avro
   /tmp/testInputStreamEOF4423343183305481378.avro
   /tmp/testInputStreamEOF7397178073669402143.avro
   /tmp/testInputStreamEOF8065492409408481522.avro
   /tmp/testInputStreamEOF8087280538995909098.avro
   /tmp/testInputStreamEOF8719004614093216771.avro
   /tmp/testInvalidMagicBytes1940432228654910095.avro
   /tmp/testInvalidMagicBytes2703760186774533143.avro
   /tmp/testInvalidMagicBytes5088097518917799234.avro
   /tmp/testInvalidMagicBytes863787801374013591.avro
   /tmp/testInvalidMagicBytes887543761182735490.avro
   /tmp/testInvalidMagicBytes980334707534164945.avro
   /tmp/testInvalidMagicLength1346115615984572207.avro
   /tmp/testInvalidMagicLength1511998921770126285.avro
   /tmp/testInvalidMagicLength1824057536245960603.avro
   /tmp/testInvalidMagicLength2005669502062311523.avro
   /tmp/testInvalidMagicLength7068591900276715585.avro
   /tmp/testInvalidMagicLength8356756206873381473.avro
   /tmp/testThrottledInputStream2962195154373996754.avro
   /tmp/testThrottledInputStream3610702487927451328.avro
   /tmp/testThrottledInputStream4661398720877824185.avro
   /tmp/testThrottledInputStream5592809458916764863.avro
   /tmp/testThrottledInputStream6489638888793454476.avro
   /tmp/testThrottledInputStream8013323018361761899.avro
   ```
   
   ## Verifying this change
   The tests still pass even after this change.
   Also, test data are deleted.
   ```
   ls /tmp/*.avro
   ls: cannot access '/tmp/*.avro': No such file or directory
   ```
   
   ## Documentation
   
   - Does this pull request introduce a new feature? (no)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] RyanSkraba merged pull request #2506: AVRO-3863: [Java] Delete temporary test data after tests finish

Posted by "RyanSkraba (via GitHub)" <gi...@apache.org>.
RyanSkraba merged PR #2506:
URL: https://github.com/apache/avro/pull/2506


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] RyanSkraba commented on a diff in pull request #2506: AVRO-3863: [Java] Delete temporary test data after tests finish

Posted by "RyanSkraba (via GitHub)" <gi...@apache.org>.
RyanSkraba commented on code in PR #2506:
URL: https://github.com/apache/avro/pull/2506#discussion_r1332015373


##########
lang/java/avro/src/test/java/org/apache/avro/io/TestEncoders.java:
##########
@@ -262,6 +262,7 @@ void arrayBackedByteBuffer() throws IOException {
   @Test
   void mappedByteBuffer() throws IOException {
     Path file = Paths.get(DIR.getPath() + "testMappedByteBuffer.avro");
+    file.toFile().deleteOnExit();

Review Comment:
   ```suggestion
       Path file = DIR.toPath().resolve( "testMappedByteBuffer.avro");
   ```
   For example: here we have a `@TempDir` already present, and cleaned up automatically in the test case -- we just accidentally forgot the path separator so the file was _outside_! 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] mystic-lama commented on a diff in pull request #2506: AVRO-3863: [Java] Delete temporary test data after tests finish

Posted by "mystic-lama (via GitHub)" <gi...@apache.org>.
mystic-lama commented on code in PR #2506:
URL: https://github.com/apache/avro/pull/2506#discussion_r1335215330


##########
lang/java/avro/src/test/java/org/apache/avro/TestDataFileReader.java:
##########
@@ -38,9 +38,12 @@
 import org.apache.avro.generic.GenericDatumReader;
 import org.apache.avro.generic.GenericDatumWriter;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 @SuppressWarnings("restriction")
 public class TestDataFileReader {
+  @TempDir
+  public Path DATA_DIR;

Review Comment:
   Can we relook at the variable name once please? This format used is for constants, giving an impression that it is static final.



##########
lang/java/avro/src/test/java/org/apache/avro/TestDataFileReader.java:
##########
@@ -38,9 +38,12 @@
 import org.apache.avro.generic.GenericDatumReader;
 import org.apache.avro.generic.GenericDatumWriter;
 import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.io.TempDir;
 
 @SuppressWarnings("restriction")
 public class TestDataFileReader {
+  @TempDir
+  public Path DATA_DIR;

Review Comment:
   Can we relook at the variable name once please? This format used is for constants, giving an impression that it is static final. Same for similar name in other classes



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [avro] sarutak commented on a diff in pull request #2506: AVRO-3863: [Java] Delete temporary test data after tests finish

Posted by "sarutak (via GitHub)" <gi...@apache.org>.
sarutak commented on code in PR #2506:
URL: https://github.com/apache/avro/pull/2506#discussion_r1332048256


##########
lang/java/avro/src/test/java/org/apache/avro/io/TestEncoders.java:
##########
@@ -262,6 +262,7 @@ void arrayBackedByteBuffer() throws IOException {
   @Test
   void mappedByteBuffer() throws IOException {
     Path file = Paths.get(DIR.getPath() + "testMappedByteBuffer.avro");
+    file.toFile().deleteOnExit();

Review Comment:
   Ah, O.K. I'll try it.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org