This issue happens because surefire kills the forked container if it times out waiting for the 'ping'.
In org.apache.maven.surefire.booter.ForkedBooter class there is hardcoded constant PING_TIMEOUT_IN_SECONDS = 20 which is used in the following method:
to create ScheduledFuture.
In some of the cases the forked container might respond a bit later than it's expected and surefire kills it
As long as we need to terminate it anyway, It would be really helpful if the problem could be solved making the PING_TIMEOUT_IN_SECONDS configurable with the ability to specify the value from maven-surefire-plugin.
It would help to configure this timeout based on needs and factors of the projects where surefire runs.