File tree 2 files changed +17
-8
lines changed
2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,5 @@ group :development do
11
11
gem "diff-lcs"
12
12
gem "rcov" , ">= 0.9.8"
13
13
gem "rdoc"
14
- gem "childprocess"
14
+ gem "childprocess" , :platform => :mri
15
15
end
Original file line number Diff line number Diff line change @@ -88,28 +88,37 @@ def run_out_of_process_with_drb
88
88
let ( :drbclient ) do
89
89
drb
90
90
DRbObject . new ( nil , 'druby://127.0.0.1:7890' ) . tap do |drbclient |
91
- ready = nil
92
- e = nil
93
- 100 . times { ( ( ready = drbclient . ready? ) && break ) rescue e = $!; sleep 0.5 }
94
- raise e unless ready
91
+ ready , error = nil , nil
92
+ 300 . times do # timeout 30 secs (300 * 0.1)
93
+ begin
94
+ break if ready = drbclient . ready?
95
+ rescue DRb ::DRbConnError => e
96
+ error = e ; sleep 0.1
97
+ end
98
+ end
99
+ raise error unless ready
95
100
end
96
101
end
97
102
98
103
let ( :drb_helper_args ) { [ "-I#{ Warbler ::WARBLER_HOME } /lib" , File . join ( @orig_dir , 'spec/drb_helper.rb' ) ] }
99
104
100
105
if defined? ( JRUBY_VERSION )
106
+ require 'jruby'
101
107
let ( :drb ) do
102
- Thread . new do
103
- ruby *drb_helper_args
108
+ version_arg = JRuby . runtime . is1_9 ? "--1.9" : "--1.8"
109
+ drb_thread = Thread . new do
110
+ ruby *( [ version_arg ] + drb_helper_args )
104
111
end
112
+ drb_thread . run
113
+ drb_thread
105
114
end
106
115
after :each do
107
116
drbclient . stop
108
117
drb . join
109
118
end
110
119
else
120
+ require 'childprocess'
111
121
let ( :drb ) do
112
- require 'childprocess'
113
122
ChildProcess . build ( FileUtils ::RUBY , *drb_helper_args ) . tap { |d | d . start }
114
123
end
115
124
after :each do
You can’t perform that action at this time.
0 commit comments