Improve runtime, reduce log output, and stabilize SSL failure assertions for SSLCertificateTest#1215
Conversation
…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>
…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
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/f0905c7d-0258-433c-be68-686a6ad569d1 Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@the-thing could you please take a look at this whenever you have the time. Thank you |
|
Sure. More AI slop. We are doomed... |
the-thing
left a comment
There was a problem hiding this comment.
Looks ok-ish. Did it improve running time and or differences across different operating systems?
Hi @the-thing , IMHO it's not slop as long as someone asked for it. :) I created an issue here #1214 to improve things.
Complete CI job time is down from about 45 mins to about 30 mins. I did not yet count how many lines of log file less. |
|
No problem. Take it with a pinch of salt. I use AI myself occasionally, but I think it is being used too much.
That is really good. |
|
@copilot please integrate proposed review changes by the-thing |
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/74ec0d16-c569-477a-80ff-9996ad4af00e Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/74ec0d16-c569-477a-80ff-9996ad4af00e Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Integrated the proposed review changes from @the-thing in Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
After the changes, the running time for the SSLCertificateTest was ~8 minutes and it was logging about ~11600 lines (compared to 45k lines before) |
SSLCertificateTestwas consuming ~20 of the CI job's ~45 minutes, logging ~45k of ~120k log lines.After the changes, the running time for the
SSLCertificateTestwas ~8 minutes and it was logging about ~11600 lines. Still much, but hey, it's a start.This PR now includes six 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
exceptionExpectedis now configured at connector construction time and stored as an immutable (final) field onTestConnectorexpectException()path;shouldFailWhen*tests now construct relevant connectors withexceptionExpected=truebeforestart()assertSslExceptionThrown(...)prepareConnectorlogs message-only when exceptions are expected, and full stack trace otherwiseinitiator/acceptorandconnectPort/acceptPort)exceptionCaught ...), and expected-path logs are explicitly marked (exceptionCaught (expected) ...)This 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.Targeted flakiness stabilization for
shouldFailWhenUsingEmptyServerKeyStore()TestInitiatorviatoAdmin(...)(MsgType.LOGON) to support this check.assertSslExceptionThrownOrLogonNotSent(...)) for clarity.This stabilizes the test across JSSE/provider/timing differences while preserving intended behavior.