This problem looks similar to
DERBY-4201, and it reproduces consistently in my environment with the repro.diff patch attached to that issue.
The problem is that NetworkServerControl.shutdown() returns once the server socket stops responding, whereas NetworkServerControlImpl.blockingStart() doesn't print the message about successful shutdown until after the server socket has been closed. So it is possible that the test checks the contents of the log after the server socket has been closed, but before the message has actually been written to the log.
The attached patch attempts to solve this race condition by making the test wait and re-read the log if the message doesn't show up immediately. This makes the test pass in my environment, also in combination with the repro patch from