deepfold.testing.utils.find_free_port

deepfold.testing.utils.find_free_port()[source]

Finds an available port and returns that port number.

NOTE: If this function is being used to allocate a port to Store (or indirectly via init_process_group or init_rpc), it should be used in conjuction with the retry_on_connect_failures decorator as there is a potential race condition where the allocated port may become unavailable before it can be used