The testcase does a server restart during the test. I believe the problem is
that it does not correctly synchronise with that server restart. It tries to
reconnect after the server has restarted. But without proper synchronisation,
the reconnect can succeed before the server has completely stopped. Then the
following queries fail as the stopping server disconnects the connection that
reconnected too early.