nic-6443 opened a new pull request, #2845:
URL: https://github.com/apache/apisix-ingress-controller/pull/2845

   ### Type of change:
   
   - [x] CI/CD or Tests
   
   ### What this PR does / why we need it:
   
   The `dataplane unavailable` spec is flaky, and it fails like this:
   
   ```
   [FAIL] Test Gateway API Status Test HTTPRoute Sync Status [It] dataplane 
unavailable
   test/e2e/gatewayapi/status.go:161
   
   [FAILED] creating service
   Unexpected error:
     The Service "apisix-standalone" is invalid: spec.ports[6].nodePort:
     Invalid value: 32746: provided port is already allocated
   ```
   
   The spec captures the dataplane Service's spec, flips the Service to 
`ExternalName` so the route sync fails, checks the `SyncFailed` status, then 
restores the captured spec. Switching to `ExternalName` releases the node ports 
the Service held, but the captured spec still names them — so the restore 
demands those exact port numbers back. The e2e suite runs many namespaces in 
parallel, so by then another Service may have been allocated one of them, and 
the restore is rejected.
   
   That race is why it passes most of the time rather than never. The fix is to 
clear `NodePort` before restoring and let the API server allocate whatever is 
free; these tests reach the dataplane through a port-forward tunnel, so the 
actual port numbers are never depended on.
   
   `test/e2e/crds/v2/status.go` has the same capture-and-restore, so it gets 
the same fix.
   
   No new test cases: this is a fix to existing tests, and the failure is a 
scheduling race that isn't worth reproducing deterministically.
   
   ### Pre-submission checklist:
   
   - [x] Did you explain what problem does this PR solve? Or what new features 
have been added?
   - [x] Have you added corresponding test cases?
   - [x] Have you modified the corresponding document?
   - [x] Is this PR backward compatible?
   


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