Skip to content

Add per-test logging to SocksProxyTest#1222

Merged
chrjohn merged 3 commits into
masterfrom
copilot/update-socks-proxy-test-logging
May 11, 2026
Merged

Add per-test logging to SocksProxyTest#1222
chrjohn merged 3 commits into
masterfrom
copilot/update-socks-proxy-test-logging

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

Intermittent SocksProxyTest failures/timeouts were hard to correlate with the active test case from CI logs alone. This updates the test to emit explicit start/finish log lines for the current JUnit test so stalled or flaky runs are easier to attribute.

  • Per-test lifecycle logging

    • Add lightweight SLF4J logging in SocksProxyTest @Before/@After hooks.
    • Emit the current test name in a consistent ClassName.methodName format.
  • JUnit 4 integration

    • Use TestName to resolve the active test method without changing test behavior or assertions.
    • Add a small fallback so lifecycle logging remains safe even if a method name is unavailable.
  • Scope

    • Keep the change isolated to quickfixj-core/src/test/java/quickfix/mina/SocksProxyTest.java.
    • Do not alter SOCKS login flow, timing, or test expectations.
@Rule
public TestName testName = new TestName();

@Before
public void setUp() {
    LOGGER.info("Starting test {}", getCurrentTestName());
}

@After
public void tearDown() {
    LOGGER.info("Finished test {}", getCurrentTestName());
}
Original prompt

Update the test class quickfixj-core/src/test/java/quickfix/mina/SocksProxyTest.java in repository quickfix-j/quickfixj to emit clear log output indicating which test is currently running. This is needed to diagnose intermittent failures such as:

SocksProxyTest.shouldLoginViaSocks4Proxy:53->shouldLoginSocksProxy:77->assertLoggedOn:103 Session FIX.4.4:ALICE->BOB is not logged on

Requirements:

  • Create a pull request against the master branch.
  • Add lightweight logging for the currently running test so CI logs make it obvious which test case is executing when a timeout or random failure occurs.
  • Keep the change focused to this test diagnostic improvement.
  • Prefer a simple, maintainable approach compatible with the existing test framework and coding style.
  • Ensure the resulting PR includes an appropriate title and description summarizing the change and rationale.

The following is the prior conversation context from the user's chat exploration (may be truncated):

User: Please create a PR which adds log output for which test is currently running. I need this to diagnose issues like these, that happen randomly:
SocksProxyTest.shouldLoginViaSocks4Proxy:53->shouldLoginSocksProxy:77->assertLoggedOn:103 Session FIX.4.4:ALICE->BOB is not logged on

Assistant: I’m waiting for your response to the confirmation dialog before I can continue creating the PR.

This pull request was created from Copilot chat.

Copilot AI and others added 2 commits May 11, 2026 07:28
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/a0c02358-15f1-4e45-aa85-eef2df0d3d7b

Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Agent-Logs-Url: https://github.com/quickfix-j/quickfixj/sessions/a0c02358-15f1-4e45-aa85-eef2df0d3d7b

Co-authored-by: chrjohn <6644028+chrjohn@users.noreply.github.com>
Copilot AI changed the title [WIP] Improve logging in SocksProxyTest for better diagnostics Improve SocksProxyTest diagnostics with per-test logging May 11, 2026
Copilot AI requested a review from chrjohn May 11, 2026 07:30
@chrjohn chrjohn changed the title Improve SocksProxyTest diagnostics with per-test logging Add per-test logging to SocksProxyTest May 11, 2026
@chrjohn chrjohn added this to the QFJ 3.0.1 milestone May 11, 2026
@chrjohn chrjohn marked this pull request as ready for review May 11, 2026 09:29
@chrjohn chrjohn merged commit eaf932f into master May 11, 2026
21 checks passed
@chrjohn chrjohn deleted the copilot/update-socks-proxy-test-logging branch May 11, 2026 09:29
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