Skip to content
This repository

Make max slaves number in magzine mode configurable #189

wants to merge 1 commit into from

5 participants

wpc Jarmo Pertman Kevin Bedell Sahil Muthoo Antonio Santos
wpc commented

I am using spork for unit testing in a JRuby Rails project. I found the default 2 slaves in magazine mode is not big enough for a fast TDD rhythm. I frequently found I used up two of slave node and get a "- NO tuple" error. So I put in a environment variable called MAX_SLAVES to configure it(default is still 2). MAX_SLAVES=6 works perfectly for me.

Jarmo Pertman

I just started to do something similar, but i'd rename variable name to be more specific to spork, e.g. SPORK_MAX_SLAVES

Kevin Bedell

Any progress on this? I have an issue where I have my rspec prefork block load some singleton factories to prepopulate my test database with some data that a large number of my tests use. However, when two slaves both try to load it they step on each other and nothing works. So I want to have only one slave run. It doesn't look like there's any way to do this --

This pull request has been out there are year -- is anyone even maintaining spork anymore? The last update was 6 months ago.

Sahil Muthoo

Closing old pull requests. Please send new ones if this is still an issue.

Sahil Muthoo sahilm closed this
Antonio Santos

@sahilm this would indeed be a nice addition, as @wpc says 2 slaves may not be enough for some people's testing pace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 20, 2012
wpc make max slaves number in magzine mode configurable through MAX_SLAVE…
…S environment variable
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/spork/run_strategy/magazine.rb
2  lib/spork/run_strategy/magazine.rb
@@ -19,7 +19,7 @@
19 19
20 20
 class Spork::RunStrategy::Magazine < Spork::RunStrategy
21 21
-  Slave_Id_Range = 1..2 # Ringserver uses id: 0. Slave use: 1..MAX_SLAVES
+  Slave_Id_Range = 1..(ENV['MAX_SLAVES'] || 2).to_i # Ringserver uses id: 0. Slave use: 1..MAX_SLAVES
23 23
24 24
   def slave_max
25 25

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.