[ 
https://issues.apache.org/jira/browse/SUREFIRE-1573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17140678#comment-17140678
 ] 

Tibor Digana commented on SUREFIRE-1573:
----------------------------------------

[~scott.cameron]
We disabled the checker in 3.0.0-M4, see the config parameter 
{{enableProcessChecker}}. We have released 3.0.0-M5 and it is still disabled by 
default. 

Instead of WMI we may use Java 9 features and call the method 
[onExit|https://docs.oracle.com/javase/9/docs/api/java/lang/ProcessHandle.html#onExit--]
 instead of the native calls. This would be perhaps much better for you. I know 
that these features are platform specific and the Javadoc has notified us about 
it and therefore we should not totally relly on the support. We will definitely 
execute the tests on Mac, Win, and Linux as always.

> PpidChecker inherits and blocks resources from tests while checking if the 
> forked VM is still alive
> ---------------------------------------------------------------------------------------------------
>
>                 Key: SUREFIRE-1573
>                 URL: https://issues.apache.org/jira/browse/SUREFIRE-1573
>             Project: Maven Surefire
>          Issue Type: Bug
>    Affects Versions: 2.22.0
>         Environment: Windows, our tests create temporary files using 
> native-code (std::fstream) and remove or rename them using boost::filesystem. 
> Java 1.8.
>            Reporter: Marcus Ackermann
>            Priority: Critical
>
> On Windows, the PpidChecker executes wmic through cmd by starting a new 
> process. Java calls {{CreateProcess}} with the flag {{bInheritHandles=TRUE}}.
> When I create a temporary file in a test, it happens that this file can 
> neither be removed nor deleted. The error code is the following (from 
> https://docs.microsoft.com/en-us/windows/desktop/debug/system-error-codes--0-499-)
> {code:java}
> ERROR_SHARING_VIOLATION
> 32 (0x20)
> The process cannot access the file because it is being used by another 
> process.{code}
> I found out that this sharing violation is due to the fact that the process 
> started from PpidChecker also owns the file inherited from the test process.
> This seems to be a side-effect of the new monitoring mechanism for the forked 
> VM introduced in 2.20.1 with SUREFIRE-1302.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to