-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
test: add info logs to help track down sporadic #5040
Conversation
if (!connectToHost(client, mainLoop)) { | ||
throw new RuntimeException(String.format("Could not connect client %s to local host - timeout.", client)); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part uses the information whether the connection was successful or not. The runtime exception will hopefully show up nicely in the test results to give us a hint that this precondition did not hold.
terasologyEngine.getFromEngineContext(SystemConfig.class).writeSaveGamesEnabled.set(false); | ||
terasologyEngine.subscribeToStateChange(new HeadlessStateChangeListener(terasologyEngine)); | ||
terasologyEngine.changeState(new TestingStateHeadlessSetup(dependencies, worldGeneratorUri)); | ||
TerasologyEngine host = createHeadlessEngine(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a rename to make it less confusing which "engine" is a client and which is a host.
We saw a sporadic test failure on
develop
builds recently (e.g., develop/709 a0c6606).To help understand which of the "engines" is actually in the wrong state, we add some logging information about the instances.
This should help to figure out whether the
createClient()
method is errorneous (as it should be blocking until the client is in state in-game) or the failure lies with the host's engine.Furthermore, this PR changes
Engines::connectToHost
to return whether waiting for the engine to enterStateIngame
succeeded or timed out. This allows to fail early and intentionally if the engine did not make it into the expected state.