gaogaotiantian opened a new pull request, #58953:
URL: https://github.com/apache/spark/pull/58953

   ### What changes were proposed in this pull request?
   
   Give each subtest iteration of
   `test_reap_server_does_not_expire_when_idle_retirement_is_disabled` its own
   `_listening_socket()` instead of sharing one listener across both iterations.
   
   ### Why are the changes needed?
   
   `_listening_socket()` calls `listen(1)` and never accepts. `reap` probes 
reachability via `_port_open`, which connects and closes without the server 
ever accepting the connection, so the completed connection keeps occupying the 
sole backlog slot. With both iterations sharing one listener, the second 
iteration's connect could not complete, timed out after 0.5s, and `is_usable()` 
returned `False` -- retiring a server that idle retirement was disabled for. 
This flaked on macOS CI (`macos-26-arm64`):
   
   ```
   FAIL: test_reap_server_does_not_expire_when_idle_retirement_is_disabled 
(value='-1')
     self.assertEqual(set(self._states(uid)), {"server"})
   AssertionError: Items in the first set but not the second: 'retired'
   ```
   
   Scoping a fresh listener per iteration matches the 
single-connect-per-listener pattern the other tests in this suite already use.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Existing unit test `LocalConnectServerPoolUnitTests` in 
`pyspark.sql.tests.connect.test_connect_local_server_pool`.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Isaac
   
   This pull request and its description were written by Isaac.


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to