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

Simon Bence updated NIFI-11559:
-------------------------------
    Description: 
In automatic checks 
_CollisionAwareResourceProviderWorkerTest#testRunWithPreExistingDirectory_ 
sometimes fails with the following error:

{code:java}
[ERROR] Tests run: 9, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 1.389 s 
<<< FAILURE! - in 
org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest
[ERROR] 
org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest.testRunWithPreExistingDirectory
  Time elapsed: 0.256 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <1> but was: <2>
        at 
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
        at 
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
        at 
org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
        at 
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
        at 
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145)
        at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:528)
        at 
org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest.assertOperationsAreFinished(CollisionAwareResourceProviderWorkerTest.java:315)
        at 
org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest.testRunWithPreExistingDirectory(CollisionAwareResourceProviderWorkerTest.java:104)
{code}

This means that the _ConflictResolvingExternalResourceProviderWorker#poll_ is 
being called twice during the test instead on one time. The _poll_ is called 
only within the worker loop thus the worker is not stopped within time. This 
can happen when the test's main thread is slower than expected and allows the 
loop to have one more iteration.

As a solution, the loop's waiting time is increased. This new value still does 
not make the tests slow or perventing them from properly running but 
significantly lowers the chance of having an extra iteration thus breaking the 
test.

  was:
In automatic checks 
CollisionAwareResourceProviderWorkerTest#testRunWithPreExistingDirectory 
sometimes fails with the following error:

{code:java}
[ERROR] Tests run: 9, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 1.389 s 
<<< FAILURE! - in 
org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest
[ERROR] 
org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest.testRunWithPreExistingDirectory
  Time elapsed: 0.256 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <1> but was: <2>
        at 
org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
        at 
org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
        at 
org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
        at 
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
        at 
org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145)
        at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:528)
        at 
org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest.assertOperationsAreFinished(CollisionAwareResourceProviderWorkerTest.java:315)
        at 
org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest.testRunWithPreExistingDirectory(CollisionAwareResourceProviderWorkerTest.java:104)
{code}

This means that the `ConflictResolvingExternalResourceProviderWorker#poll` is 
being called twice during the test instead on one time. The `poll` is called 
only within the worker loop thus the worker is not stopped within time. This 
can happen when the test's main thread is slower than expected and allows the 
loop to have one more iteration.

As a solution, the loop's waiting time is increased. This new value still does 
not make the tests slow or perventing them from properly running but 
significantly lowers the chance of having an extra iteration thus breaking the 
test.


> Refinement on 
> CollisionAwareResourceProviderWorkerTest#testRunWithPreExistingDirectory
> --------------------------------------------------------------------------------------
>
>                 Key: NIFI-11559
>                 URL: https://issues.apache.org/jira/browse/NIFI-11559
>             Project: Apache NiFi
>          Issue Type: Improvement
>          Components: Core Framework
>            Reporter: Simon Bence
>            Assignee: Simon Bence
>            Priority: Major
>
> In automatic checks 
> _CollisionAwareResourceProviderWorkerTest#testRunWithPreExistingDirectory_ 
> sometimes fails with the following error:
> {code:java}
> [ERROR] Tests run: 9, Failures: 1, Errors: 0, Skipped: 2, Time elapsed: 1.389 
> s <<< FAILURE! - in 
> org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest
> [ERROR] 
> org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest.testRunWithPreExistingDirectory
>   Time elapsed: 0.256 s  <<< FAILURE!
> org.opentest4j.AssertionFailedError: expected: <1> but was: <2>
>       at 
> org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
>       at 
> org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
>       at 
> org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
>       at 
> org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:150)
>       at 
> org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:145)
>       at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:528)
>       at 
> org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest.assertOperationsAreFinished(CollisionAwareResourceProviderWorkerTest.java:315)
>       at 
> org.apache.nifi.flow.resource.CollisionAwareResourceProviderWorkerTest.testRunWithPreExistingDirectory(CollisionAwareResourceProviderWorkerTest.java:104)
> {code}
> This means that the _ConflictResolvingExternalResourceProviderWorker#poll_ is 
> being called twice during the test instead on one time. The _poll_ is called 
> only within the worker loop thus the worker is not stopped within time. This 
> can happen when the test's main thread is slower than expected and allows the 
> loop to have one more iteration.
> As a solution, the loop's waiting time is increased. This new value still 
> does not make the tests slow or perventing them from properly running but 
> significantly lowers the chance of having an extra iteration thus breaking 
> the test.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to