Improve runtime and reduce log output for SSLCertificateTest#1215
Improve runtime and reduce log output for SSLCertificateTest#1215
SSLCertificateTest#1215Conversation
…rallelize no-exception checks Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/f464dac4-ab03-4de1-a750-fbcb1d6bd19c Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
…rror messages Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/f464dac4-ab03-4de1-a750-fbcb1d6bd19c Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
| @Override | ||
| public void exceptionCaught(NextFilter nextFilter, IoSession session, Throwable cause) { | ||
| LOGGER.info("exceptionCaught", cause); | ||
| LOGGER.info("exceptionCaught: {}", cause.getMessage()); |
There was a problem hiding this comment.
@copilot this reduces the exceptions for ALL cases, not only when they are expected.
When an exception is expected: log only the message.
When no exception is expected and an exception occurs: log the exception with stack trace.
An exception is expected when assertSslExceptionThrown is called on a connector. That connector then needs to be initialized with a boolean flag or similar so that the exceptionCaught handler knows when to log the full exception with stack trace or just the message.
There was a problem hiding this comment.
Fixed in 433a0d5. Added a volatile boolean exceptionExpected flag to TestConnector. assertSslExceptionThrown sets it to true before waiting on the latch. The exceptionCaught handler now logs message-only when exceptionExpected is true, and the full stack trace otherwise.
…Caught handler Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/064bbb3a-a6bf-4600-bf29-db71d02c5845 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
SSLCertificateTest
SSLCertificateTestSSLCertificateTest
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/d64730b5-aa97-44bd-9061-f58167740bad Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/84ec41ca-7a14-49eb-ae78-d83bfe444cf6 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Refactor createDefaults method to initialize defaults directly.
…lts() overload Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/51422522-fc50-446b-a611-8461f3651a3e Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
SSLCertificateTestSSLCertificateTest
|
@copilot looking good so far. However, there still are many expected exceptions logged since we set |
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/e076da92-89f9-49bd-8c6f-70c6e763a7b5 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Fixed in f66e237. Added |
|
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/6a765d0a-c7ee-4073-b490-7c33e6d2c912 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Done in dd263e0:
|
SSLCertificateTestwas consuming ~20 of the CI job's ~45 minutes, logging ~45k of ~120k log lines. Four targeted fixes:Timeout and heartbeat tuning
TIMEOUT_SECONDS: 15s → 7sHeartBtInt: 30s → 5s across all session settings builders — a heartbeat exchange within the window is sufficient to confirm a healthy sessionReduce log noise for expected failures
volatile boolean exceptionExpectedflag onTestConnector, startsfalseexpectException()method toTestConnector— called on each connector immediately after construction and beforestart()in allshouldFailWhen*methodsprepareConnectorchecks the flag inexceptionCaught: logs message-only whentrue, full stack trace whenfalseThis cuts the bulk of log output generated by
shouldFailWhen*tests.Parallel no-exception checks
Added
assertNoSslExceptionsThrown(TestConnector... connectors)— runs each connector's latch-wait concurrently instead of sequentially. For a test with N connectors this replaces N×7s with a single 7s wait.Threads are named (
ssl-check<Type><index>) for debuggability. On failure, a composite error message summarises all failures upfront with individual errors as suppressed exceptions. Applied across 15 test methods.Test name logging
Added a class-level
LOGGERand a@Rule TestNamefield toSSLCertificateTest. The existing@Before setUp()now logs>>> Running test: <methodName>before every test, making it easy to correlate log output with the active test method in CI logs.