[tests] Fix a problem with the successive binding of lots of sockets to random ports

1 job for v1.4.0 in 14 minutes and 27 seconds (queued for 10 seconds)
latest
Status Name Job ID Coverage
  Build
failed build #88138
docker-build

00:14:27

 
Name Stage Failure
failed
build Build There is an unknown failure, please try again


--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 381 tests in 832.275s

FAILED (errors=9, failures=23)
ERROR: Job failed: exit status 1