Skip to content

Readme.md references File.lock, which doesn't seem to be a thing #1012

@maxjacobson

Description

@maxjacobson

First of all, thanks for this very useful gem!

Regarding this from the Readme.md:

Running setup or teardown once

require "parallel_tests"

# preparation:
# affected by race-condition: first process may boot slower than the second
# either sleep a bit or use a lock for example File.lock
ParallelTests.first_process? ? do_something : sleep(1)

AFAICT, File.lock is not part of the Ruby standard library. Is it perhaps from a gem? I do see File#flock, but I'm not too familiar with it. Maybe that's what this was referring to?

It would be helpful to have a working example with a lock if possible.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions