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:
|
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/259e69cc-5c31-44d1-b506-ba6599711d6a Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
| LOGGER.info("exceptionCaught: {}", cause.getMessage()); | ||
| } else { | ||
| LOGGER.info("exceptionCaught", cause); |
There was a problem hiding this comment.
@copilot this logging would be better when I knew which connector exactly was logging this. Please add the connection type and accept/connect port to the log line before the "exceptionCaught".
There was a problem hiding this comment.
Done in 671559f. The exceptionCaught log lines now include the connector type (initiator/acceptor) and the relevant connectPort/acceptPort before exceptionCaught.
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/31a93f02-e16d-44c6-a083-87625a05f967 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
SSLCertificateTestwas consuming ~20 of the CI job's ~45 minutes, logging ~45k of ~120k log lines. Five 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 sessionReconnect interval cleanup
Initiator.SETTING_RECONNECT_INTERVALoverrides in this test class so the default 30 second reconnect interval is usedReduce 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 whenfalseinitiator/acceptorandconnectPort/acceptPort) so remaining SSL noise can be traced back to the exact connectorThis cuts the bulk of log output generated by
shouldFailWhen*tests while making the remaining output easier to attribute.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.