You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avro.apache.org by "Gabriel Reid (JIRA)" <ji...@apache.org> on 2012/09/07 22:50:07 UTC

[jira] [Created] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Gabriel Reid created AVRO-1150:
----------------------------------

             Summary: TestSpecificCompiler leaks temporary directories
                 Key: AVRO-1150
                 URL: https://issues.apache.org/jira/browse/AVRO-1150
             Project: Avro
          Issue Type: Bug
          Components: java
            Reporter: Gabriel Reid
            Priority: Minor
         Attachments: AVRO-1150.patch

The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.

This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Posted by "Gabriel Reid (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13456044#comment-13456044 ] 

Gabriel Reid commented on AVRO-1150:
------------------------------------

Ok, thanks for the pointer on that, I'll go for that approach.
                
> TestSpecificCompiler leaks temporary directories
> ------------------------------------------------
>
>                 Key: AVRO-1150
>                 URL: https://issues.apache.org/jira/browse/AVRO-1150
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gabriel Reid
>            Priority: Minor
>         Attachments: AVRO-1150.patch
>
>
> The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.
> This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455875#comment-13455875 ] 

Doug Cutting commented on AVRO-1150:
------------------------------------

I think you can instead just add a dependency on the test code from another module.  For example, to have ipc tests rely on avro tests, add the following to ipc/pom.xml:

{code}
    <dependency>
      <groupId>org.apache.avro</groupId>
      <artifactId>avro</artifactId>
      <classifier>tests</classifier>
      <scope>test</scope>
      <version>${project.version}</version>
    </dependency>
{code}

The classifier says you want the classes from lang/java/avro/src/test/java, and the scope says you want to use these in lang/java/ipc/src/test/java.

I think we can eliminate the redundancy this way without publishing a test module, which might require us to keep test APIs back-compatible.
                
> TestSpecificCompiler leaks temporary directories
> ------------------------------------------------
>
>                 Key: AVRO-1150
>                 URL: https://issues.apache.org/jira/browse/AVRO-1150
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gabriel Reid
>            Priority: Minor
>         Attachments: AVRO-1150.patch
>
>
> The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.
> This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Cutting resolved AVRO-1150.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 1.7.2
         Assignee: Gabriel Reid

I committed this.  Thanks, Gabriel!
                
> TestSpecificCompiler leaks temporary directories
> ------------------------------------------------
>
>                 Key: AVRO-1150
>                 URL: https://issues.apache.org/jira/browse/AVRO-1150
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gabriel Reid
>            Assignee: Gabriel Reid
>            Priority: Minor
>             Fix For: 1.7.2
>
>         Attachments: AVRO-1150.patch, AVRO-1150.patch
>
>
> The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.
> This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Posted by "Gabriel Reid (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gabriel Reid updated AVRO-1150:
-------------------------------

    Attachment: AVRO-1150.patch

Patch that moves to a single AvroTestUtil class, and removes all creation of temporary files and directories under tmp (or java.io.tmpdir). 

All temporary files and directories are now created under target/tmpfiles in a directory specific to the test class that is creating the file or directory.

Run successfully against "mvn verify".
                
> TestSpecificCompiler leaks temporary directories
> ------------------------------------------------
>
>                 Key: AVRO-1150
>                 URL: https://issues.apache.org/jira/browse/AVRO-1150
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gabriel Reid
>            Priority: Minor
>         Attachments: AVRO-1150.patch, AVRO-1150.patch
>
>
> The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.
> This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Posted by "Gabriel Reid (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AVRO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gabriel Reid updated AVRO-1150:
-------------------------------

    Attachment: AVRO-1150.patch

Simple patch to resolve the issue.
                
> TestSpecificCompiler leaks temporary directories
> ------------------------------------------------
>
>                 Key: AVRO-1150
>                 URL: https://issues.apache.org/jira/browse/AVRO-1150
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gabriel Reid
>            Priority: Minor
>         Attachments: AVRO-1150.patch
>
>
> The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.
> This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Posted by "Gabriel Reid (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13455663#comment-13455663 ] 

Gabriel Reid commented on AVRO-1150:
------------------------------------

There's a AvroTestUtil class that handles creation of temporary directories under target/ -- however, it's copied in the avro, ipc, and tools modules. 

I was thinking of making an avro-test module to contain a single copy of this class, and build it out a bit to include segregating temp files per test class. Any objections to this approach, particularly about the creation of a new module?
                
> TestSpecificCompiler leaks temporary directories
> ------------------------------------------------
>
>                 Key: AVRO-1150
>                 URL: https://issues.apache.org/jira/browse/AVRO-1150
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gabriel Reid
>            Priority: Minor
>         Attachments: AVRO-1150.patch
>
>
> The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.
> This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13452512#comment-13452512 ] 

Doug Cutting commented on AVRO-1150:
------------------------------------

I generally prefer it when tests leave their files around until they're run the next time so that one can better examine output when debugging.  The 'clean' target should remove them.  Is that not sufficient?
                
> TestSpecificCompiler leaks temporary directories
> ------------------------------------------------
>
>                 Key: AVRO-1150
>                 URL: https://issues.apache.org/jira/browse/AVRO-1150
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gabriel Reid
>            Priority: Minor
>         Attachments: AVRO-1150.patch
>
>
> The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.
> This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13454272#comment-13454272 ] 

Doug Cutting commented on AVRO-1150:
------------------------------------

Yes, I think we should fix tests so they don't create files outside of the target/ directory.  In particular, we shouldn't use /tmp.
                
> TestSpecificCompiler leaks temporary directories
> ------------------------------------------------
>
>                 Key: AVRO-1150
>                 URL: https://issues.apache.org/jira/browse/AVRO-1150
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gabriel Reid
>            Priority: Minor
>         Attachments: AVRO-1150.patch
>
>
> The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.
> This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (AVRO-1150) TestSpecificCompiler leaks temporary directories

Posted by "Gabriel Reid (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AVRO-1150?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13453792#comment-13453792 ] 

Gabriel Reid commented on AVRO-1150:
------------------------------------

That makes sense. This specific test isn't doing that though -- instead, it's doing a partial job of cleaning up after itself, and the files that it's making aren't under target, they're under the system's temp directory. For now this patch is just fixing the incomplete cleanup.

If you think it's useful, I'd be happy to go through the tests and make it more consistent so that a temp directory under target is used, with cleanup of temporary files/directories only being done as part of the clean target. What do you think?
                
> TestSpecificCompiler leaks temporary directories
> ------------------------------------------------
>
>                 Key: AVRO-1150
>                 URL: https://issues.apache.org/jira/browse/AVRO-1150
>             Project: Avro
>          Issue Type: Bug
>          Components: java
>            Reporter: Gabriel Reid
>            Priority: Minor
>         Attachments: AVRO-1150.patch
>
>
> The test class org.apache.avro.compiler.TestSpecificCompiler (in the compiler sub-project) creates a temporary directory, but only deletes the contents of the directory at the end of the test, and not the directory itself.
> This will cause a (small) issue on the long term when running in CI.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira