Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for locks in rules #263

Merged
1 commit merged into from
Sep 29, 2017
Merged

Add support for locks in rules #263

1 commit merged into from
Sep 29, 2017

Conversation

ghost
Copy link

@ghost ghost commented Sep 22, 2017

/cc @samoht

This PR allows users to specify that some action must be executed while holding some locks:

(alias
 ((name   runtest)
  (locks  (m))
  (action (...))))

In some cases, people want to make sure that some non-conventional tests don't run in parallel, and this PR allows to do that without having to resort to -j1.

Locks could be implemented in the action language, or even outside of jbuilder by taking a lock file. However having them in jbuilder allows to avoid monopolizing a job just for waiting on a lock.

CHANGES.md Outdated
@@ -16,6 +16,8 @@ next
current directory. This allows Emacs and Vim to know where relative
filenames should be interpreted from. Fixes #138

- Add support for locks in actions, for flaky tests

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, my tests are not flacky :p they just happen to use an OS resources (e.g. a port) and they would like to have exclusive access to it :-)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, that makes sense

@samoht
Copy link
Member

samoht commented Sep 23, 2017

That looks great, thanks!

This is to allow users define more complicated tests without having
to resort to -j1.
@ghost ghost merged commit 5de73ca into master Sep 29, 2017
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants