Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
both tests fail on Windows with an error like [INFO] Running org.openmrs.obs.BinaryStreamHandlerTest Jul 17, 2020 11:42:59 AM org.junit.jupiter.engine.execution.JupiterEngineExecutionContext close SEVERE: Caught exception while closing extension context: org.junit.jupiter.engine.descriptor.MethodExtensionContext@4fa274 java.io.IOException: Failed to delete temp directory ...\AppData\Local\Temp\junit9081338062257189768. The following paths could not be deleted (see suppressed exceptions for details): , TestingComplexObsSaving_1d883c5b-ae87-4e42-b5aa-2171b58c51da.dat, TestingComplexObsSaving_27cc4781-b820-466d-834c-70b4d221d24f.dat ... Suppressed: java.nio.file.FileSystemException: ...\AppData\Local\Temp\junit9081338062257189768\TestingComplexObsSaving_1d883c5b-ae87-4e42-b5aa-2171b58c51da.dat: The process cannot access the file because it is being used by another process. Looking at spring-io/initializr#862 it could well be that we are facing the same problem that we are not properly closing our streams before exiting the test. Thus wrapping them in a try-with resource block. This theory makes sense since the saveObs uses OpenmrsUtil.copyFile which does not close the inputstream but only the outputstream.
- Loading branch information
Showing
2 changed files
with
45 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters