Justin Chen created CXF-8697:
--------------------------------

             Summary: 2 Order-Dependent Flaky Tests for CachedOutputStream 
                 Key: CXF-8697
                 URL: https://issues.apache.org/jira/browse/CXF-8697
             Project: CXF
          Issue Type: Test
          Components: Core
            Reporter: Justin Chen


The tests {{org.apache.cxf.io.CacheAndWriteOutputStreamTest.testDeleteTmpFile}} 
and {{org.apache.cxf.io.CachedOutputStreamTest.testDeleteTmpFile}} fail when 
run by themselves with the command {{mvn test}} because the temporary file is 
null. The reason is because {{createFileOutPutStream}} is never called in the 
method {{enforceLimits}} in the {{CachedOutputStream}} class since the 
{{threshold}} instance variable is not greater than the {{totalLength}} 
variable. The threshold variable depends on the static variable 
{{{}defaultThreshold{}}}. The {{defaultThreshold}} also depends on the system 
property. Therefore, these tests pass when the whole test suite is run because 
a different test, such as {{testUseSysProps,}} changes the static variable 
along with the system property.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to