Skip to content

Add a method to create a server subprocesses only on unused local ports #1124

@MVrachev

Description

@MVrachev

Description of issue or feature request:
It will be useful to make sure we are starting the server subprocesses only on unused local ports.
This will save us issues when the server is started on used local ports and given that more tests using server subprocesses could be added in the future, then we have even a better stimulus to create such a method.

It's preferable if we find a way to do this atomically e.g. check if the port is busy and start the server almost instantly because we want to minimize the possibility that that port could be taken between the port validation and server startup.

Current behavior:
There is no such functionality in TUF and sometimes I am getting [Errno 98] Address already in use or ConnectionRefusedError: [Errno 111].

Expected behavior:
Hopefully, none of the above errors will ever appear after we add this functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions