You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2022/04/30 22:58:04 UTC
[GitHub] [cxf] jchen8460 opened a new pull request, #942: [CXF-8697] Fix order-dependent flaky tests
jchen8460 opened a new pull request, #942:
URL: https://github.com/apache/cxf/pull/942
**Issue**
[Jira Issue](https://issues.apache.org/jira/browse/CXF-8697?jql=project%20%3D%20CXF%20AND%20resolution%20%3D%20Unresolved%20AND%20text%20~%20%22CachedOutputStream%22%20ORDER%20BY%20priority%20DESC%2C%20updated%20DESC)
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 the method `createFileOutPutStream` is never called in the method `enforceLimits` in `CachedOutputStream` 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.
**Solution**
In order to allow these two tests to pass on their own, the system property must first be set to 4. Next, the static variables need to be updated with a call to `reloadDefaultProperties`. Since the previous version of these tests do not change system properties and static variables, the test should then reset the system property to the original state once finished executing. Please let me know if you would like me to reset the state differently.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cxf] amarkevich commented on pull request #942: [CXF-8697] Fix order-dependent flaky tests
Posted by GitBox <gi...@apache.org>.
amarkevich commented on PR #942:
URL: https://github.com/apache/cxf/pull/942#issuecomment-1114316447
or use explicit threshold value in the test instead:
`Object cache = createCache(64 * 1024);`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cxf] amarkevich merged pull request #942: [CXF-8697] Fix order-dependent flaky tests
Posted by GitBox <gi...@apache.org>.
amarkevich merged PR #942:
URL: https://github.com/apache/cxf/pull/942
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cxf] jchen8460 commented on pull request #942: [CXF-8697] Fix order-dependent flaky tests
Posted by GitBox <gi...@apache.org>.
jchen8460 commented on PR #942:
URL: https://github.com/apache/cxf/pull/942#issuecomment-1114497620
Yes, that would work as well. I suggested the other way because almost all the tests use the default `createCache()`, so I thought that the test was trying to test the system property and the threshold as well. Since that is not the case, I have made a new commit that uses your suggestion. Please let me know if you have any other comments.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cxf] amarkevich commented on pull request #942: [CXF-8697] Fix order-dependent flaky tests
Posted by GitBox <gi...@apache.org>.
amarkevich commented on PR #942:
URL: https://github.com/apache/cxf/pull/942#issuecomment-1114552215
@jchen8460 its fine, thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org