Skip to content
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

Check for server not starting in TCK FATs #30307

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ public void runTCK() throws IOException, Exception {
// Validate configured settings
TCKUtilities.requireDirectory(tckRunnerDir);

// Validate server started ok (for tests that start the server in advance)
if (server.isStarted()) {
TCKUtilities.assertServerHappy(server);
}

// Configure Artifactory
File wrapperPropertiesFile = TCKUtilities.exportMvnWrapper(this.tckRunnerDir);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.empty;
import static org.hamcrest.Matchers.greaterThan;
import static org.junit.Assert.assertEquals;

Expand Down Expand Up @@ -52,6 +53,7 @@

import com.ibm.websphere.simplicity.log.Log;

import componenttest.topology.impl.LibertyServer;
import componenttest.topology.utils.tck.TCKResultsInfo.TCKJarInfo;
import componenttest.topology.utils.tck.TCKResultsInfo.Type;
import junit.framework.AssertionFailedError;
Expand Down Expand Up @@ -849,4 +851,18 @@ static void requireExists(File file) throws IOException {
throw new IOException(file + " does not exist");
}
}

/**
* Assert that the server has started successfully and hasn't hit any known problems.
*
* @param server the server to check
* @throws Exception
*/
static void assertServerHappy(LibertyServer server) throws Exception {
// LibertyServer.start will already have checked for the server started successfully message
// Look for errors that indicate a failure to start correctly but don't prevent liberty reporting a successful start
assertThat("Server log has errors after starting", server.findStringsInLogs("CWWKF0001E"), empty()); // A feature definition could not be found for ...
assertThat("Server log has errors after starting", server.findStringsInLogs("CWWKF0002E"), empty()); // A bundle could not be found for ...
assertThat("Server log has errors after starting", server.findStringsInLogs("CWWKE0702E"), empty()); // Could not resolve module ...
}
}