Repository navigation
Update Test Server Runner (Major Version) - #1617
Conversation
Additionally - fixed a flaky test - improved test configuration files
|
Claude finished @scottf's task in 4m 56s โโ View job PR Review: Update Test Server Runner (Major Version)Tasks:
Review SummaryThe PR is a clean mechanical migration from Issues1. SNAPSHOT dependency (inline comment on SNAPSHOT artifacts are mutable โ the same coordinates can resolve to different bytecode across builds and CI runs. This breaks reproducibility and makes regressions hard to bisect. Should be replaced with a final release version before landing on 2. Privileged WS ports in static config files (inline comment on
Positive changes worth noting
|
|
|
||
| testImplementation 'org.junit.jupiter:junit-jupiter:5.14.1' | ||
| testImplementation 'io.nats:jnats-server-runner:3.0.1' | ||
| testImplementation 'io.nats:jnats-server-runner:4.0.1-SNAPSHOT' |
There was a problem hiding this comment.
SNAPSHOT dependency makes builds non-reproducible โ the artifact can change under CI without a version bump. Please resolve to a final release (4.0.1 or whatever the stable tag is) before merging to main.
|
@claude. Please re-review considering comments |
|
Claude finished @scottf's task in 3m 23s โโ View job Re-Review: Update Test Server Runner (Major Version)Tasks:
Updated ReviewIssue 1: SNAPSHOT dependency โ Resolved โConfirmed fixed. No SNAPSHOT suffix. This is correct. Issue 2: Privileged WS ports โ Original analysis was wrongScott's correction is accurate. Reading # "<ws>" in the port line will be replaced with a generated port
# and will be retrievable via NatsTestServer.getPort("ws")The runner pre-processes the config and replaces port placeholders before handing the config to the NATS server. In Minor observation: stale comment in ws.conf
The current v4 API is Other changes look correct
SummaryBoth issues from the initial review have been addressed โ the SNAPSHOT is resolved, and the port concern was based on a misunderstanding of the runner's behavior. The PR is a clean migration with two solid improvements (flaky test fix, hub port fix in |
| assertFalse(ses.isShutdown()); | ||
|
|
||
| options = standardOptionsBuilder(server.getNatsLocalhostUri()) | ||
| options = standardOptionsBuilder(server.getURI()) |
There was a problem hiding this comment.
Why are these renaming the opposite way to the others?
There was a problem hiding this comment.
I added the getUri because if I didn't, a lot more files would have been touched. getNatsLocalhostUri is superseded by a change in the tool library.
| String[] servers = new String[]{ | ||
| ts1.getNatsLocalhostUri(), | ||
| ts2.getNatsLocalhostUri() | ||
| ts1.getURI(), |
There was a problem hiding this comment.
Again here, why renaming the other way, this time definitely methods on the test server?
| server(ts.getURI()).errorListener(listener).build())) { | ||
| NatsConnection nc = (NatsConnection) Nats.connect( | ||
| new Options.Builder(). | ||
| server(ts.getURI()) |
There was a problem hiding this comment.
This seems a candidate for the rename too?
| NatsTestServer.builder() | ||
| .configFilePath("src/test/resources/tls_first.conf") | ||
| .connectValidateTlsFirstMode()) | ||
| .skipConnectValidate()) |
There was a problem hiding this comment.
Why skip validation? Also line 467.
And then some renames in the opposite direction, as previously noted.
There was a problem hiding this comment.
Validate is done by the tool that starts the server. But it assumes a regular server mode not tls first. this is a shortcoming in the tool. So the test will fail if the tool tries to validate the server connection.
|
|
||
| standardRequestReply(Options.builder(). | ||
| server(getLocalhostUri("ws", ts.getPort("ws"))) | ||
| server(getLocalhostUri("ws", ts.getNonNatsPort())) |
There was a problem hiding this comment.
This getNonNatsPort seems to me an odd naming choice, since NATS supports MQTT too and might support others in future. Seems better to use something named for WS, or stick to something which passes the protocol in as a parameter as before.
There was a problem hiding this comment.
The server runner has had use in handling regular connections (nats port) and websocket connections (non nats port). But without adding additional behavior to specifically understand every single block in the server config to the server runner, non nats port covers whatever type of other port.
Additionally