mxtymoshyk opened a new pull request, #40291:
URL: https://github.com/apache/beam/pull/40291
Fixes #30225.
Fixes #40289.
Three fixes for timing-dependent failures in `JmsIOTest`. All are test-only.
**`testCheckpointMarkSafety` (qpid): NPE on a null message (#30225)**
```
java.lang.NullPointerException: Cannot invoke
"org.apache.qpid.jms.message.JmsTextMessage.getAcknowledgeCallback()" because
"message" is null
```
The slow-ack proxy (`proxyMethod`) passed every `receiveNoWait()` result to
the ack-delaying transformer, including `null`. With prefetch disabled,
`receiveNoWait()` can legally return `null` on a slow runner (see #30225).
JmsIO already handles that, but the test wrapper then dereferenced the null.
The proxy now only wraps non-null results.
**`reader.start()` can also see no message yet (#30225)**
`advanceWithRetry()` (#36976) already covers `advance()` returning false for
the same reason, but every `assertTrue(reader.start())` was still unguarded.
This adds `startWithRetry()`, which falls back to `advanceWithRetry()`, and
uses it in all seven places.
**`testAuthenticationWithBadPassword` / `testAuthenticationRequired`
(ActiveMQ) (#40289)**
```
Expected: a string containing "User name [test_user] or password is invalid."
but: was "peer (vm://localhost:43505?transport.transformer=jms#97)
stopped."
```
After an authentication failure, the ActiveMQ broker stops the connection
shortly afterwards. With the default async `vm://` transport, the security
error reply can still be waiting on the client side when the stop arrives. On a
CPU-starved runner the client then fails with `peer ... stopped.` instead of
the auth error. For ActiveMQ, the two auth tests now use a synchronous `vm://`
transport (`?async=false`), so the reply is delivered first. The assertions are
not relaxed. The qpid (amqp) parameter is unchanged.
Locally: `:sdks:java:io:jms:test --tests JmsIOTest` passes (48/48), and
`spotlessJavaCheck` passes.
------------------------
Thank you for your contribution! Follow this checklist to help us
incorporate your contribution quickly and easily:
- [x] Mention the appropriate issue in your description (for example:
`addresses #123`), if applicable. This will automatically add a link to the
pull request in the issue. If you would like the issue to automatically close
on merging the pull request, comment `fixes #<ISSUE NUMBER>` instead.
- [ ] Update `CHANGES.md` with noteworthy changes.
- [ ] If this contribution is large, please file an Apache [Individual
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
See the [Contributor Guide](https://beam.apache.org/contribute) for more
tips on [how to make review process
smoother](https://github.com/apache/beam/blob/master/CONTRIBUTING.md#make-the-reviewers-job-easier).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]