Skip to content

Using lock files for port reservation #247

Open
@dmitry-lipetsk

Description

@dmitry-lipetsk

Testgres must use lock files to prevent a reservation of the same port by multiple parallel workers.

The current implementation allows the reservation of one port number by multiple parallel workers (on pytest, for eaxample).

It creates the real situation when two test uses one port and do not know about it. Example:

  • One test allocates the port for PG and get it.
  • Another test allocates the same port for Proxima. Proxima does not work but hosted PG is working!

As result, the second test may do not know that it works with wrong port.

Usage of lock files (in the one directory) must help solve this problem.

What are problems?

  1. Testgres may work with "remote" instance of Postgres. So Lock directory must to be on this "remote" host.

Remote host may do not has a direct access to our host and cannot verify that our process directly though PID as TAP tests.

As variant - we can do it through TCP/IP connection. I do not plan to implement it right now but this thing is great task for guys who want to join us )

  1. Different locations of lock files directory

We have to provide the way to explicit definition of lock files directory path.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions