You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "SEPURI-SAI-KRISHNA (via GitHub)" <gi...@apache.org> on 2026/09/22 07:02:11 UTC

[PR] [Test][Connector-V2] Strengthen the restored MqttSource assertions [seatunnel]

SEPURI-SAI-KRISHNA opened a new pull request, #12436:
URL: https://github.com/apache/seatunnel/pull/12436

   ### Purpose of this pull request
   
   Follow-up to #12416. That PR merged at 04:37Z, shortly before I had folded in the review points @SEZ9 and @DanielLeens raised on it, so those improvements are not on `dev`. This carries exactly those and nothing else.
   
   `MqttSourceConfigTest` is already identical to `dev`, so this touches a single file.
   
   ### What changes
   
   **The restored `sourceConfig` is now checked for its value, not just its presence.** #12416 built a reader from the deserialized source and asserted only that it did not throw. That distinguishes a lost `sourceConfig` from a present one, but it observes nothing inside it, and the source was built from `baseConfig()` so every field carried its default. The source now sets `max_queue_size = 1`, which is not the default, and the restored reader is driven past that limit, mirroring `testReaderFailsWhenMessageQueueIsFull`.
   
   **Both halves of the boundedness pair are asserted again.** #12416 removed `assertEquals(Boundedness.UNBOUNDED, restored.getBoundedness())` because it cannot detect a lost job context. That is true, but as @SEZ9 pointed out it was the half that detects a context restored with a null `jobMode`: `STREAMING.equals(null)` is false, so such a context throws in the STREAMING case, while the BATCH test cannot tell it apart from a genuine BATCH context. The comment now says the two are complementary.
   
   **A factual error in a comment is corrected.** It said `sourceConfig` is "the third and last field of `MqttSource`". The declaration order is `sourceConfig`, `catalogTable`, `jobContext`, so it is the first. The ordinal is dropped rather than renumbered so it cannot go stale if the fields are reordered.
   
   Not included: @SEZ9's Issue 5, a shared `fullConfig()` helper for `testExplicitValues` and the round-trip test. The drift it describes is real, but it means rewriting a neighbouring test that is not broken, so I would rather do it separately if wanted.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. One test file. `MqttSource`, `MqttSourceConfig` and `MqttSourceReader` are byte-identical to `dev`.
   
   ### How was this patch tested?
   
   ```
   ./mvnw -pl seatunnel-connectors-v2/connector-mqtt test
   Tests run: 34, Failures: 0, Errors: 0, Skipped: 0
   ```
   
   `spotless:check` is green.
   
   Two mutations, to show the new assertion has teeth and to be precise about what it adds:
   
   | Mutation | Old assertion | New assertion |
   |---|---|---|
   | `maxQueueSize` marked `transient` | fails | fails |
   | `MqttSourceReader` hardcodes `new LinkedBlockingQueue<>(2048)` | **passes** | fails |
   
   The first does not separate them, which supports @DanielLeens's point that a pure serialization defect fails `MqttSourceConfigTest` regardless. The second does: it is a config-to-reader wiring defect rather than a serialization one. `testReaderFailsWhenMessageQueueIsFull` also catches it, so the new assertion is not uniquely responsible; what is new is that it is caught on a deserialized source.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][Connector-V2] Strengthen the restored MqttSource assertions [seatunnel]

Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo merged PR #12436:
URL: https://github.com/apache/seatunnel/pull/12436


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Test][Connector-V2] Strengthen the restored MqttSource assertions [seatunnel]

Posted by "SEPURI-SAI-KRISHNA (via GitHub)" <gi...@apache.org>.
SEPURI-SAI-KRISHNA commented on PR #12436:
URL: https://github.com/apache/seatunnel/pull/12436#issuecomment-5781505596

   Thanks @davidzollo, and the point is fair. Taking it.
   
   For the record rather than as a defence: #12408 is the Zeta E2E test for the MQTT source and #12436 is unit-level assertions in `connector-mqtt`, so they were different modules and different layers rather than two attempts at the same thing. But you are right that from the outside they read as one concern arriving twice, and the count is worse than those two: #12406, #12410, #12416, #12436 and #12408 are five PRs on MQTT source coverage in three days.
   
   The real cause is worth stating because it is fixable. Each of #12410, #12416 and #12436 exists because review feedback arrived after the previous PR had already merged, so there was nothing left to fold it into. #12436 is the clearest case: it merged at 04:37 and my commit with the review fixes is timestamped 05:07, half an hour late. I should have checked the merge state before pushing rather than after.
   
   What I will do differently: there are two MQTT items still outstanding, a `MqttSink` Java-serialization round-trip test that @DanielLeens asked for as #12416 Issue 2, and a one-word comment correction he flagged on #12436 (it says the `max_queue_size` default is 2048; it is 1000). Those would naturally have been two more PRs. They will be one, and that will be the last MQTT PR from me unless something is actually broken.
   


-- 
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: commits-unsubscribe@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org