[
https://issues.apache.org/jira/browse/NIFI-2089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15347032#comment-15347032
]
ASF GitHub Bot commented on NIFI-2089:
--------------------------------------
GitHub user markap14 opened a pull request:
https://github.com/apache/nifi/pull/573
NIFI-2089: Ensure streams are closed before attempting to remove files
Also fixed buggy unit tests that did not properly utilize the Content
Repository API but instead attempted to write to files directly
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/markap14/nifi NIFI-2089
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/573.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #573
----
commit a4281ae4197428dd3f4f14450467f78068e2345b
Author: Mark Payne <[email protected]>
Date: 2016-06-23T19:21:44Z
NIFI-2089: Ensure streams are closed before attempting to remove files
----
> NIFI-1824 causes failures on Windows
> ------------------------------------
>
> Key: NIFI-2089
> URL: https://issues.apache.org/jira/browse/NIFI-2089
> Project: Apache NiFi
> Issue Type: Bug
> Reporter: Joseph Percivall
> Assignee: Mark Payne
> Priority: Blocker
> Fix For: 1.0.0, 0.7.0
>
>
> Below is the output of a maven build of the current 0.x branch on Windows 8.
> After reverting NIFI-1824 (commit 1ff55244ceca8220dbfdc3ca58eb42218536579f)
> the test succeeds.
> Output:
> -------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running org.apache.nifi.cluster.HeartbeatPayloadTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.266 sec -
> in org.apache.nifi.cluster.HeartbeatPayloadTest
> Running org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0 sec - in
> org.apache.nifi.controller.repository.io.TestLimitedInputStream
> Running org.apache.nifi.controller.repository.TestFileSystemRepository
> Tests run: 28, Failures: 1, Errors: 2, Skipped: 0, Time elapsed: 33.81 sec
> <<< FAILURE! - in
> org.apache.nifi.controller.repository.TestFileSystemRepository
> testRemoveDeletesFileIfNoClaimants(org.apache.nifi.controller.repository.TestFileSystemRepository)
> Time elapsed: 0.86 sec <<< FAILURE!
> java.lang.AssertionError: null
> at org.junit.Assert.fail(Assert.java:86)
> at org.junit.Assert.assertTrue(Assert.java:41)
> at org.junit.Assert.assertFalse(Assert.java:64)
> at org.junit.Assert.assertFalse(Assert.java:74)
> at
> org.apache.nifi.controller.repository.TestFileSystemRepository.testRemoveDeletesFileIfNoClaimants(TestFileSystemRepository.java:274)
> testExportToFile(org.apache.nifi.controller.repository.TestFileSystemRepository)
> Time elapsed: 0.867 sec <<< ERROR!
> java.nio.file.FileSystemException:
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638368813-1:
> The process cannot access the file because it is being used by another
> process.
> at
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToFile(TestFileSystemRepository.java:348)
> testExportToOutputStream(org.apache.nifi.controller.repository.TestFileSystemRepository)
> Time elapsed: 0.859 sec <<< ERROR!
> java.nio.file.FileSystemException:
> C:\Users\Joe\AppData\Local\Programs\Git\nifi\nifi-nar-bundles\nifi-framework-bundle\nifi-framework\nifi-framework-core\target\content_repository\1\1466638376837-1:
> The process cannot access the file because it is being used by another
> process.
> at
> sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
> at
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
> at
> sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
> at sun.nio.fs.WindowsFileCopy.copy(WindowsFileCopy.java:165)
> at
> sun.nio.fs.WindowsFileSystemProvider.copy(WindowsFileSystemProvider.java:278)
> at java.nio.file.Files.copy(Files.java:1274)
> at
> org.apache.nifi.controller.repository.TestFileSystemRepository.testExportToOutputStream(TestFileSystemRepository.java:335)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)