Log JVM Arguments at in-JVM Test Class Initialization

patch by Natnael Adere; reviewed by Caleb Rackliffe, David Capwell for CASSANDRA-16664
This commit is contained in:
Natnael Adere 2022-11-01 10:45:02 -07:00 committed by David Capwell
parent 8ec04361b9
commit 9a0dd603b1
3 changed files with 13 additions and 2 deletions

View File

@ -250,7 +250,7 @@ public class CassandraDaemon
ThreadAwareSecurityManager.install();
logSystemInfo();
logSystemInfo(logger);
NativeLibrary.tryMlockall();
@ -626,7 +626,7 @@ public class CassandraDaemon
return setupCompleted;
}
private void logSystemInfo()
public static void logSystemInfo(Logger logger)
{
if (logger.isInfoEnabled())
{

View File

@ -596,6 +596,7 @@ public class Instance extends IsolatedExecutor implements IInvokableInstance
FileUtils.setFSErrorHandler(new DefaultFSErrorHandler());
DatabaseDescriptor.createAllDirectories();
CassandraDaemon.getInstanceForTesting().migrateSystemDataIfNeeded();
CassandraDaemon.logSystemInfo(inInstancelogger);
CommitLog.instance.start();
CassandraDaemon.getInstanceForTesting().runStartupChecks();

View File

@ -94,6 +94,16 @@ public class JVMDTestTest extends TestBaseImpl
}
}
@Test
public void jvmArgumentLoggingTest() throws IOException
{
try (Cluster cluster = Cluster.build(1).start())
{
LogAction logs = cluster.get(1).logs();
Assertions.assertThat(logs.grep("JVM Arguments").getResult()).isNotEmpty();
}
}
@Test
public void nonSharedConfigClassTest() throws IOException
{