SEPURI-SAI-KRISHNA opened a new issue, #13164:
URL: https://github.com/apache/seatunnel/issues/13164

   ### Search before asking
   
   - [X] I had searched in the 
[issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22Bug%22)
 and found no similar issues. #13030 fixed this pattern in two other fixtures. 
#13028 fixed one of the two classes below, but it was closed without merging on 
the day #13030 merged. #13030 does not touch that class, so `dev` still has the 
fixed port.
   
   ### What happened
   
   `RestApiHttpBasicTest` and `RestApiHttpsForTruststoreTest` can fail in 
`@BeforeAll` with `IllegalStateException: Node failed to start!` after 300 
seconds, on changes that do not touch them.
   
   Both extend `AbstractSeaTunnelServerTest`, which gives Hazelcast a random 
base port from `TestUtils` (10000 to 30000) and scans 100 ports from there. 
Both also use a fixed port inside that range. If the scan covers the fixed 
port, Hazelcast keeps connecting to the test's own REST listener and the node 
never starts. #13030 describes the same collision.
   
   Two failures on my fork, on changes unrelated to these tests:
   
   | Class | Fixed port | Hazelcast base | Job |
   |---|---|---|---|
   | `RestApiHttpBasicTest` | 18081 | 17984 | [Windows, JDK 
17](https://github.com/SEPURI-SAI-KRISHNA/seatunnel/actions/runs/41384280101/job/125083707704)
 |
   | `RestApiHttpsForTruststoreTest` | 18443 | 18372 | [Ubuntu, JDK 
17](https://github.com/SEPURI-SAI-KRISHNA/seatunnel/actions/runs/40647673893/job/122683152950)
 |
   
   In both logs the member connects to the fixed port repeatedly until it gives 
up. In the second the log also shows `Unknown protocol`. 
`RestApiHttpsForTruststoreTest` failing this way was also reported on #12640 
and #13143. I did not read those two logs.
   
   I reproduced both on `dev` with a throwaway subclass that overrides 
`getHazelcastPort()` to return the base port from the job above, one run each 
on JDK 17:
   
   | Class | Hazelcast base | Result |
   |---|---|---|
   | `RestApiHttpBasicTest` | 17984 | `Node failed to start!` after 301.7 s, 
repeated connections to 18081 |
   | `RestApiHttpsForTruststoreTest` | 18372 | `Node failed to start!` after 
302.0 s, 9 `Unknown protocol` lines |
   
   A 100 port scan covers a given port for about 0.5% of the possible base 
ports, so each class should hit this in about 1 of 200 runs. This is 
arithmetic, not a measured rate.
   
   The other fixed ports in these tests are not affected, as far as I can read 
the code:
   
   - `GetNodeHttpPortOperationTest` only sets 18085 in a config object. That 
test does not start a server.
   - `RestApiSubmitJobConfigShadeDecryptTest` (24000) and 
`RestApiSubmitJobContentTypeTest` (26000) turn discovery off.
   - `RestApiHttpsTest` uses ports assigned by the OS.
   
   I would like to submit a PR that allocates these two ports through 
`TestUtils`, as #13030 did.
   
   ### SeaTunnel Version
   
   dev (e25c90a016). I ran the reproduction on 9b8252eaf0, and the engine 
server tests have not changed since.
   
   ### SeaTunnel Config
   
   ```conf
   Not applicable, this is a unit test fixture.
   ```
   
   ### Running Command
   
   ```shell
   # After building the module and its dependencies. A plain run passes unless 
the random
   # base port happens to cover the fixed port, so the runs above used the 
subclass.
   ./mvnw -B surefire:test -pl seatunnel-engine/seatunnel-engine-server 
-DskipUT=false -Dtest='RestApiHttpBasicTest,RestApiHttpsForTruststoreTest' 
-DfailIfNoTests=false
   ```
   
   ### Error Exception
   
   ```log
   java.lang.IllegalStateException: Node failed to start!
        at 
org.apache.seatunnel.engine.server.rest.RestApiHttpBasicTest.before(RestApiHttpBasicTest.java:95)
   ```
   
   ### Zeta or Flink or Spark Version
   
   Zeta (dev)
   
   ### Java or Scala Version
   
   JDK 17
   
   ### Screenshots
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of 
Conduct](https://www.apache.org/foundation/policies/conduct)
   


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

  • [I] [Bug][Zeta] Two REST tests... SEPURI-SAI-KRISHNA (via GitHub) via commits

Reply via email to