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

   Yes, glad to contribute to Apache SeaTunnel.
   
   ### Purpose of this pull request
   
   Closes #13164.
   
   `RestApiHttpBasicTest` and `RestApiHttpsForTruststoreTest` used fixed ports 
(18081 and 18443) inside the range `TestUtils` allocates Hazelcast ports from. 
When the discovery scan covered the fixed port, Hazelcast kept connecting to 
the test's own REST listener and the class failed with `Node failed to start!` 
after 300 seconds.
   
   This PR allocates both ports through `TestUtils`, as #13030 did for two 
other fixtures. `TestUtils` tracks the ranges it has handed out, so the REST 
port cannot fall inside a Hazelcast range in the same JVM.
   
   #13028 made this change for `RestApiHttpsForTruststoreTest` and also 
replaced `httpPort`. It was closed without merging on the day #13030 merged, 
and #13030 does not touch that class. This PR keeps the change to one line per 
class. `httpPort` stays as it is because HTTP is disabled in that fixture, so 
nothing listens on it.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. This changes test fixtures only.
   
   ### How was this patch tested?
   
   **Forced collision**, with a throwaway subclass that overrides 
`getHazelcastPort()` to return the base port from the failing CI jobs linked in 
the issue, JDK 17:
   
   ```
                                     Hazelcast base   dev (one run)             
        this PR
   RestApiHttpBasicTest              17984            Node failed to start!, 
301.7 s    5 tests pass
   RestApiHttpsForTruststoreTest     18372            Node failed to start!, 
302.0 s    4 tests pass
   ```
   
   With this PR those base ports no longer collide because the REST port has 
moved, so that run alone proves little. The guarantee comes from the allocator, 
so I also checked it directly: a throwaway program allocated one port and then 
a 100 port range, as these fixtures do, until the pool ran out at 115 pairs. No 
port fell inside any range. 
`TestUtilsTest.getAvailablePortReturnsNonOverlappingPortRanges` already covers 
this, which is why this PR adds no new test.
   
   **Real tests:**
   
   - Both classes, JDK 11 and 17: 5 and 4 tests pass.
   - Both classes, 5 more runs on JDK 17: all pass, on a different port each 
run.
   - The whole `rest` package together, JDK 17: 44 tests in 9 classes pass.
   - [This fork 
run](https://github.com/SEPURI-SAI-KRISHNA/seatunnel/actions/runs/42253664904) 
on this commit passes on its second attempt. Both classes pass on Ubuntu, JDK 
11 and 17, and `RestApiHttpBasicTest` passes on Windows, JDK 11 and 17. Two 
other jobs failed on the first attempt and passed on rerun: `connector-redis-it 
(11)` could not download the Maven wrapper (HTTP 429), and 
`SeaTunnelClientTest.testGetMultiTableJobMetrics` failed in `unit-test (11, 
ubuntu-latest)`. That test is in `seatunnel-engine-client` and does not use 
these classes. I do not know why it failed.
   
   **Not tested:** Windows locally. `RestApiHttpsForTruststoreTest` is disabled 
on Windows.
   
   **Limit of this fix:** it removes one cause of `Node failed to start!`, not 
every cause. For example, `JobMasterTest` [failed this 
way](https://github.com/SEPURI-SAI-KRISHNA/seatunnel/actions/runs/42158635009/job/127700024033)
 with no fixed port and no output from the server, and I do not know why.
   
   Also run: `spotless:check`, and `verify -DskipTests` on 
`seatunnel-engine-server`.
   
   ### Check list
   
   * [x] If any new Jar binary package adding in your PR, please add License 
Notice according
     [New License 
Guide](https://github.com/apache/seatunnel/blob/dev/docs/en/developer/new-license.md)
 (no new jar)
   * [x] If necessary, please update the documentation to describe the new 
feature. https://github.com/apache/seatunnel/tree/dev/docs (not needed)
   * [x] If necessary, please update `incompatible-changes.md` to describe the 
incompatibility caused by this PR. (not needed)
   


-- 
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]

  • [PR] [Fix][Zeta] Keep two REST... SEPURI-SAI-KRISHNA (via GitHub) via commits

Reply via email to