Intermittent build failure in gs-main ResourcePoolTest tear down

Description

Seen locally and on Jenkins, ResourcePoolTest tear down occasionally fails when it is unable to delete its temporary data directory, almost certainly because it is not empty, likely because an H2 thread has not finished shutting down and has written a file between directory content deletion and directory deletion:
https://build.geoserver.org/job/geoserver-master/5355/consoleText

This could be fixed by forcing synchronous shutdown of H2 if such a mechanism exists, or by a short Thread.sleep before recursive directory removal. The latter could be applied to all GeoServer tests.

Environment

None

Status

Assignee

Unassigned

Reporter

Ben Caradoc-Davies

Triage

Fix versions

None

Affects versions

Components

Priority

Medium
Configure