[
https://issues.apache.org/jira/browse/GEODE-8555?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17204361#comment-17204361
]
ASF GitHub Bot commented on GEODE-8555:
---------------------------------------
kirklund commented on a change in pull request #5569:
URL: https://github.com/apache/geode/pull/5569#discussion_r497146639
##########
File path:
geode-junit/src/main/java/org/apache/geode/internal/cache/DiskRegionTestingBase.java
##########
@@ -200,6 +202,19 @@ protected void deleteFiles() {
tempDir.delete();
}
+ protected void forceDeleteFiles() {
+ closeDiskStores();
+ File file = tempDir.getRoot();
+ File[] files = file.listFiles();
+ for (File each : files) {
+ try {
+ FileUtils.forceDelete(each);
+ } catch (IOException e) {
+ LogService.getLogger().error("Caught", e);
Review comment:
Instead of logging the error, can we add and use ErrorCollector? I would
just add this to DiskRegionTestingBase up where the other Rules are defined.
```
@Rule
public ErrorCollector errorCollector = new ErrorCollector();
```
And then:
```
try {
FileUtils.forceDelete(each);
} catch (IOException e) {
errorCollector.addError(e);
}
```
After each test finishes, (if any were thrown) ErrorCollector will fail the
test and print out every stack trace.
Since SimpleDiskRegionJUnitTest is an integration test, logging the stack
traces won't cause the test to fail like a distributed test would.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
> SimpleDiskRegionJunitTest fails on Windows
> ------------------------------------------
>
> Key: GEODE-8555
> URL: https://issues.apache.org/jira/browse/GEODE-8555
> Project: Geode
> Issue Type: Test
> Components: core
> Affects Versions: 1.14.0
> Reporter: Raymond Ingles
> Assignee: Sarah Abbey
> Priority: Major
> Labels: pull-request-available
>
> Updating Junit to 4.13, one test failed on Windows due to failure to delete
> some temporary test files.
> https://concourse.apachegeode-ci.info/teams/main/pipelines/apache-develop-main/jobs/WindowsCoreIntegrationTestOpenJDK8/builds/455
> {code:java}
> org.apache.geode.internal.cache.SimpleDiskRegionJUnitTest > testBasicClose
> FAILED
> java.lang.AssertionError: Exception in createOverflowOnly due to
> java.lang.IllegalStateException: The region "/testRegion" has been persisted
> to disk so it can not be recreated on the same disk store without
> persistence. Either destroy the persistent region, recreate it as overflow
> and persistent, or create the overflow only region on a different disk store.
> at org.junit.Assert.fail(Assert.java:89)
> at
> org.apache.geode.internal.cache.SimpleDiskRegionJUnitTest.testBasicClose(SimpleDiskRegionJUnitTest.java:75)
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)