Skip to content

Add testcluster node log location to gradle run error message #127665

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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 @@ -592,7 +592,14 @@ public void waitForAllConditions() {
writeUnicastHostsFiles();

LOGGER.info("Starting to wait for cluster to form");
waitForConditions(waitConditions, System.currentTimeMillis(), CLUSTER_UP_TIMEOUT, CLUSTER_UP_TIMEOUT_UNIT, this);
waitForConditions(
waitConditions,
getFirstNode().getLogsDir().toString(),
System.currentTimeMillis(),
CLUSTER_UP_TIMEOUT,
CLUSTER_UP_TIMEOUT_UNIT,
this
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,11 @@ public Path getConfigDir() {
return configFile.getParent();
}

@Internal
public Path getLogsDir() {
return confPathLogs;
}

@Override
@Input
public boolean isPreserveDataDir() {
Expand Down Expand Up @@ -1621,12 +1626,19 @@ public boolean isProcessAlive() {
}

void waitForAllConditions() {
waitForConditions(waitConditions, System.currentTimeMillis(), NODE_UP_TIMEOUT_UNIT.toMillis(NODE_UP_TIMEOUT) +
// Installing plugins at config time and loading them when nods start requires additional time we need to
// account for
ADDITIONAL_CONFIG_TIMEOUT_UNIT.toMillis(
ADDITIONAL_CONFIG_TIMEOUT * (plugins.size() + keystoreFiles.size() + keystoreSettings.size() + credentials.size())
), TimeUnit.MILLISECONDS, this);
waitForConditions(
waitConditions,
confPathLogs.toString(),
System.currentTimeMillis(),
NODE_UP_TIMEOUT_UNIT.toMillis(NODE_UP_TIMEOUT) +
// Installing plugins at config time and loading them when nods start requires additional time we need to
// account for
ADDITIONAL_CONFIG_TIMEOUT_UNIT.toMillis(
ADDITIONAL_CONFIG_TIMEOUT * (plugins.size() + keystoreFiles.size() + keystoreSettings.size() + credentials.size())
),
TimeUnit.MILLISECONDS,
this
);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ public interface TestClusterConfiguration {

default void waitForConditions(
LinkedHashMap<String, Predicate<TestClusterConfiguration>> waitConditions,
String logsPath,
long startedAtMillis,
long nodeUpTimeout,
TimeUnit nodeUpTimeoutUnit,
Expand All @@ -142,7 +143,9 @@ default void waitForConditions(
Throwable lastException = null;
while (System.currentTimeMillis() - startedAtMillis < TimeUnit.MILLISECONDS.convert(nodeUpTimeout, nodeUpTimeoutUnit)) {
if (context.isProcessAlive() == false) {
throw new TestClustersException("process was found dead while waiting for " + description + ", " + this);
throw new TestClustersException(
"process was found dead while waiting for " + description + ", " + this + ". Node logs available at: " + logsPath
);
}

try {
Expand Down