Skip to content

Improve test feedback by logging the availability checks for OpenSSL and Tomcat Native libraries when they're missing#970

Open
csutherl wants to merge 1 commit intoapache:mainfrom
csutherl:add-warnings-for-missing-openssl-tcnative
Open

Improve test feedback by logging the availability checks for OpenSSL and Tomcat Native libraries when they're missing#970
csutherl wants to merge 1 commit intoapache:mainfrom
csutherl:add-warnings-for-missing-openssl-tcnative

Conversation

@csutherl
Copy link
Copy Markdown
Member

When running the tests without OpenSSL or Tomcat Native installed, there are several things happening without a clear explanation (without having to dig into individual test outputs):

  • OpenSSL cipher tests are silently excluded via build configuration
  • Tomcat Native tests are skipped via Assume.assumeTrue() checks
  • Users only see "Skipped: N" in test results, which requires looking into which were skipped
  • There's no proactive feedback about these missing libraries

Adding a warning when the libraries are missing allows you to check the target output to confirm that natives are being included in the tests without prior knowledge of which tests would be skipped when they're missing.

@dsoumis
Copy link
Copy Markdown
Member

dsoumis commented Mar 27, 2026

If tomcat-native is installed system-wide for example /usr/lib as is currently in Fedora, JVM will load it but the test.apr.loc check will fail.

@csutherl
Copy link
Copy Markdown
Member Author

You're right. We could document setting test.apr.loc to the local binaries as a requirement to get the benefit of the check, but given that it doesn't actually do anything if it fails to find it and the library will still load at runtime, the message being inaccurate is the only issue, right?

@csutherl
Copy link
Copy Markdown
Member Author

On second thought, the best option is to create a small class to load it at runtime to confirm it actually loads rather than string matching env vars...otherwise there's always the potential for runtime issues that you can't check for. I can add a java library path check, but it's still not completely accurate if there's any runtime errors.

@dsoumis
Copy link
Copy Markdown
Member

dsoumis commented Apr 1, 2026

+1 on the class which loads the library at runtime. This way incompatible versions can also be checked rather than checking only .so files existence.
I can't think of any potential accuracy impact that you mention through runtime errors, what am I missing?

@csutherl csutherl force-pushed the add-warnings-for-missing-openssl-tcnative branch from f52e5ee to b11e867 Compare April 1, 2026 18:32
@csutherl
Copy link
Copy Markdown
Member Author

csutherl commented Apr 1, 2026

I added a small test to check that the library actually loads rather than using the TesterSSL test because it takes ages. This meant I included a dependency on the test-compile target to compile the test class. I could just add javac to avoid that if we think it's an issue. Also I couldn't figure out a way to avoid some of the platform specific location settings so open to ideas on that.

@csutherl csutherl force-pushed the add-warnings-for-missing-openssl-tcnative branch from b11e867 to b3fe0f6 Compare April 3, 2026 18:20
When either are unavailable, the tests are silently skipped or
excluded without a clear explanation to the user. The new warning
makes it obvious that the OpenSSL or Tomcat Native tests will
be skipped without having the look for which tests were skipped.
@csutherl csutherl force-pushed the add-warnings-for-missing-openssl-tcnative branch from b3fe0f6 to a17b753 Compare April 3, 2026 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants