You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Aleksandr Polovtcev (Jira)" <ji...@apache.org> on 2021/10/21 16:27:00 UTC

[jira] [Updated] (IGNITE-15799) WorkDirectoryExtension can fail if all tests in a class are muted

     [ https://issues.apache.org/jira/browse/IGNITE-15799?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Aleksandr Polovtcev updated IGNITE-15799:
-----------------------------------------
    Description: 
If a test class declares a field marked with the {{WorkDirectory}} annotation and all of its test methods are marked as {{Disabled}}, then JUnit does not instantiate the test class instance. However, the {{BeforeAll}} and {{AfterAll}} callbacks are still run, so the following error may appear:
{code:java}
java.nio.file.NoSuchFileException: target/work	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
	at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:412)
	at java.base/java.nio.file.Files.newDirectoryStream(Files.java:471)
	at java.base/java.nio.file.Files.list(Files.java:3696)
	at org.apache.ignite.internal.testframework.WorkDirectoryExtension.afterAll(WorkDirectoryExtension.java:101)
{code}
{{WorkDirectoryExtension#afterAll}} method should be modified to check if the temporary folder actually exists before checking if it's empty.

  was:If a test class declares a field marked with the {{WorkDirectory}} annotation and all of its test methods are marked as {{Disabled}}, then JUnit does not instantiate the test class instance. However, the `BeforeAll` and `AfterAll` callbacks are still run, so the following error may appear:


> WorkDirectoryExtension can fail if all tests in a class are muted
> -----------------------------------------------------------------
>
>                 Key: IGNITE-15799
>                 URL: https://issues.apache.org/jira/browse/IGNITE-15799
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Aleksandr Polovtcev
>            Assignee: Aleksandr Polovtcev
>            Priority: Minor
>              Labels: ignite-3
>
> If a test class declares a field marked with the {{WorkDirectory}} annotation and all of its test methods are marked as {{Disabled}}, then JUnit does not instantiate the test class instance. However, the {{BeforeAll}} and {{AfterAll}} callbacks are still run, so the following error may appear:
> {code:java}
> java.nio.file.NoSuchFileException: target/work	at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
> 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
> 	at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
> 	at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:412)
> 	at java.base/java.nio.file.Files.newDirectoryStream(Files.java:471)
> 	at java.base/java.nio.file.Files.list(Files.java:3696)
> 	at org.apache.ignite.internal.testframework.WorkDirectoryExtension.afterAll(WorkDirectoryExtension.java:101)
> {code}
> {{WorkDirectoryExtension#afterAll}} method should be modified to check if the temporary folder actually exists before checking if it's empty.



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