nzw921rx opened a new pull request, #10989:
URL: https://github.com/apache/seatunnel/pull/10989

   ### Purpose of this pull request
   
   Fix Redis E2E flaky tests (`RedisClusterIT`, `RedisTestCaseTemplateIT`) — 
multiple issues across resource management, cluster readiness, timing, and 
assertions causing intermittent CI failures.
   
   **Resource issues:**
   - Add `@ResourceLock("redis-standalone-e2e")` to `Redis5IT` / `Redis7IT` to 
prevent parallel execution conflicts on shared Docker network alias `redis-e2e`
   - Add `@ResourceLock("redis-cluster-e2e")` to `RedisClusterIT` and 
`@ResourceLock("redis-master-slave-e2e")` to `RedisMasterAndSlaveIT` to prevent 
port conflicts on fixed host bindings
   
   **Cluster setup issues:**
   - Fix container network alias mismatch: Java code created 1-based aliases 
(`redis-cluster-1/2/3`) while config files referenced 0-based 
(`redis-cluster-0/1/2`); aligned to 0-based
   - Replace fragile `getHostIpAddress()` (manual `NetworkInterface` 
enumeration, last-match-wins) with `getDockerHostIp()` using Testcontainers 
`GenericContainer.getHost()` API
   - Replace PING-only cluster readiness check with `CLUSTER INFO` polling — 
now verifies `cluster_state:ok` and `cluster_slots_ok:16384` (full slot 
coverage), with 30 retries × 2s interval
   - Remove `Thread.sleep(5000)` after `redis-cli --cluster create`; cluster 
readiness is fully covered by the `CLUSTER INFO` polling loop
   
   **Assertion issues:**
   - Fix `testRedisClusterScan` finally block: used `llen` (LIST command) to 
verify deletion of a SET-type key `key_set`; replaced with `exists` 
(type-agnostic) to avoid `WRONGTYPE` exception masking `del` failures
   
   **Timing issues:**
   - Replace `Thread.sleep(60_000)` in `testRedisWithExpire` with 
`Awaitility.await()` polling (90s atMost, 3s pollInterval) to check 
`jedis.llen("key_list") == 0` after TTL expiry
   - Fix `testFakeToRedisInRealTimeTest` async race: retain `CompletableFuture` 
reference and check `isCompletedExceptionally()` in the Awaitility assertion; 
increase timeout from 60s to 120s with 2s poll interval
   
   ### Does this PR introduce _any_ user-facing change?
   
   No. Test-only changes.
   
   ### How was this patch tested?
   
   ```bash
   ./mvnw -pl seatunnel-e2e/seatunnel-connector-v2-e2e/connector-redis-e2e 
-DskipUT -DskipIT=false verify
   ```
   


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

Reply via email to