Otavio Rodolfo Piske created CAMEL-20686:
--------------------------------------------

             Summary: camel-core: review File tests for incorrectly shared 
resources
                 Key: CAMEL-20686
                 URL: https://issues.apache.org/jira/browse/CAMEL-20686
             Project: Camel
          Issue Type: Task
          Components: camel-core
    Affects Versions: 4.6.0
            Reporter: Otavio Rodolfo Piske
             Fix For: 4.x


We have lots of file tests in core that run in parallel and try to write to the 
same file. This leads to a lot of flakiness in file tests.

 

Look for tests doing things like {{testFile("output.txt")}} or 
{{testFile("input.txt")}} or other similar repetitive names (i.e.: {{{}foo{}}}, 
{{{}bar{}}}, etc) should be considered suspicious and need careful review.

 

The tests should be adjusted to one of the following (in order of preference):
 * Use separate resources for each test (i.e: "{{{}input." + 
TestClass.class.getSimpleName() + ".txt"{}}})
 * Use JUnit's 5 temporary file provider
 * Use resource locks via JUnit's {{@ResourceLock}} annotation.
 * Or Isolated if safe to do so



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

Reply via email to