If the test wasn't started successfully, for example Keycloak server fails to start, there's this NPE thrown by the registry:
java.lang.NullPointerException: Cannot invoke "Object.getClass()" because "testInstance" is null
at org.keycloak.testframework.injection.Registry.executeSetup(Registry.java:267)
at org.keycloak.testframework.injection.Registry.afterAll(Registry.java:286)
at org.keycloak.testframework.KeycloakIntegrationTestExtension.afterAll(KeycloakIntegrationTestExtension.java:44)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
This is caused by lack of checking if currentTestInstance is not set in afterAll, and it won't be set unless the test was successfully initialised.