Skip to content

Commit 7f10d15

Browse files
committed
More buggy tests, fix #590
1 parent f297472 commit 7f10d15

File tree

7 files changed

+30
-29
lines changed

7 files changed

+30
-29
lines changed

Rakefile

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ require 'concurrent/version'
66
require 'concurrent/utility/native_extension_loader'
77

88
## load the gemspec files
9-
CORE_GEMSPEC = Gem::Specification.load('concurrent-ruby.gemspec')
10-
EXT_GEMSPEC = Gem::Specification.load('concurrent-ruby-ext.gemspec')
11-
EDGE_GEMSPEC = Gem::Specification.load('concurrent-ruby-edge.gemspec')
9+
CORE_GEMSPEC = Gem::Specification.load('concurrent-ruby.gemspec')
10+
EXT_GEMSPEC = Gem::Specification.load('concurrent-ruby-ext.gemspec')
11+
EDGE_GEMSPEC = Gem::Specification.load('concurrent-ruby-edge.gemspec')
1212

1313
## constants used for compile/build tasks
1414

@@ -18,7 +18,7 @@ EDGE_NAME = 'edge'
1818
JAVA_EXT_NAME = 'concurrent_ruby_ext'
1919

2020
if Concurrent.on_jruby?
21-
CORE_GEM = "#{GEM_NAME}-#{Concurrent::VERSION}-java.gem"
21+
CORE_GEM = "#{GEM_NAME}-#{Concurrent::VERSION}-java.gem"
2222
else
2323
CORE_GEM = "#{GEM_NAME}-#{Concurrent::VERSION}.gem"
2424
EXT_GEM = "#{GEM_NAME}-ext-#{Concurrent::VERSION}.gem"
@@ -66,17 +66,17 @@ elsif Concurrent.allow_c_extensions?
6666
require 'rake/extensiontask'
6767

6868
Rake::ExtensionTask.new(EXT_NAME, EXT_GEMSPEC) do |ext|
69-
ext.ext_dir = 'ext/concurrent'
70-
ext.lib_dir = 'lib/concurrent'
69+
ext.ext_dir = 'ext/concurrent'
70+
ext.lib_dir = 'lib/concurrent'
7171
ext.source_pattern = '*.{c,h}'
72-
ext.cross_compile = true
72+
ext.cross_compile = true
7373
ext.cross_platform = ['x86-mingw32', 'x64-mingw32']
7474
end
7575

7676
ENV['RUBY_CC_VERSION'].to_s.split(':').each do |ruby_version|
7777
platforms = {
78-
'x86-mingw32' => 'i686-w64-mingw32',
79-
'x64-mingw32' => 'x86_64-w64-mingw32'
78+
'x86-mingw32' => 'i686-w64-mingw32',
79+
'x64-mingw32' => 'x86_64-w64-mingw32'
8080
}
8181
platforms.each do |platform, prefix|
8282
task "copy:#{EXT_NAME}:#{platform}:#{ruby_version}" do |t|
@@ -177,23 +177,20 @@ begin
177177

178178
RSpec::Core::RakeTask.new(:spec)
179179

180+
options = %w[ --color
181+
--backtrace
182+
--seed 1
183+
--format documentation
184+
--tag ~unfinished
185+
--tag ~notravis
186+
--tag ~buggy ]
187+
180188
RSpec::Core::RakeTask.new(:travis) do |t|
181-
t.rspec_opts = '--color ' \
182-
'--backtrace ' \
183-
'--tag ~unfinished ' \
184-
'--seed 1 ' \
185-
'--format documentation ' \
186-
'--tag ~notravis ' \
187-
'--tag ~buggy'
189+
t.rspec_opts = ['--color', *options].join(' ')
188190
end
189191

190192
RSpec::Core::RakeTask.new(:appveyor) do |t|
191-
t.rspec_opts = '--backtrace ' \
192-
'--tag ~unfinished ' \
193-
'--seed 1 ' \
194-
'--format documentation ' \
195-
'--tag ~notravis ' \
196-
'--tag ~buggy'
193+
t.rspec_opts = [*options].join(' ')
197194
end
198195

199196
if Concurrent.on_windows?

spec/concurrent/atomic/cyclic_barrier_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ module Concurrent
5757

5858
describe 'reset' do
5959
it 'should release all waiting threads', buggy: true do
60-
start_latch = CountDownLatch.new(1)
60+
start_latch = CountDownLatch.new(1)
6161
continue_latch = CountDownLatch.new(1)
6262

6363
Thread.new do
@@ -120,7 +120,7 @@ module Concurrent
120120
expect(latch.wait(1)).to be_truthy
121121
end
122122

123-
it 'return false if barrier has been reset' do
123+
it 'return false if barrier has been reset', buggy: true do
124124
latch = CountDownLatch.new(1)
125125

126126
t = Thread.new { latch.count_down if barrier.wait == false }
@@ -230,7 +230,7 @@ def barrier.simulate_spurious_wake_up
230230

231231
it 'should resist to spurious wake ups without timeout' do
232232
@expected = false
233-
t = Thread.new { barrier.wait; @expected = true }
233+
t = Thread.new { barrier.wait; @expected = true }
234234
t.join(0.1)
235235

236236
barrier.simulate_spurious_wake_up
@@ -241,7 +241,7 @@ def barrier.simulate_spurious_wake_up
241241

242242
it 'should resist to spurious wake ups with timeout' do
243243
@expected = false
244-
t = Thread.new { barrier.wait(0.5); @expected = true }
244+
t = Thread.new { barrier.wait(0.5); @expected = true }
245245

246246
t.join(0.1)
247247
barrier.simulate_spurious_wake_up

spec/concurrent/atomic/reentrant_read_write_lock_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def wait_up_to(secs, &condition)
260260
end
261261
end
262262

263-
it "wakes up waiting readers when the write lock is released" do
263+
it "wakes up waiting readers when the write lock is released", buggy: true do
264264
latch1,latch2 = CountDownLatch.new,CountDownLatch.new
265265
good = AtomicFixnum.new(0)
266266
threads = [
@@ -271,6 +271,7 @@ def wait_up_to(secs, &condition)
271271
]
272272
wait_up_to(0.2) { threads[3].status == 'sleep' }
273273
# The last 3 threads should be waiting to acquire read locks now...
274+
# TODO (pitr-ch 15-Oct-2016): https://travis-ci.org/ruby-concurrency/concurrent-ruby/jobs/166777543
274275
(1..3).each { |n| expect(threads[n].status).to eql "sleep" }
275276
(1..3).each { |n| expect(threads[n]).not_to hold(lock).for_read }
276277
# Throw latch2 and the writer will wake up and release its write lock...

spec/concurrent/channel/buffer/base_shared.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
end
9090
t.join(0.1)
9191

92+
# TODO (pitr-ch 15-Oct-2016): fails on JRuby https://travis-ci.org/pitr-ch/concurrent-ruby/jobs/167937038
9293
expect(subject.poll).to eq 42
9394
end
9495

spec/concurrent/channel_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module Concurrent
22

3-
describe Channel, edge: true do
3+
describe Channel, edge: true, buggy: true do
44

55
context 'initialization' do
66

spec/concurrent/mvar_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,8 @@ def m.simulate_spurious_wake_up
387387
expect(m.put(14)).to eq 14
388388
end
389389

390-
it 'returns TIMEOUT on timeout on a full MVar' do
390+
it 'returns TIMEOUT on timeout on a full MVar', buggy: true do
391+
# TODO (pitr-ch 15-Oct-2016): fails on jruby
391392
result = nil
392393
Thread.new { result = m.put(14, 0.3) }
393394
sleep(0.1)

spec/concurrent/synchronization_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ def ns_initialize
144144
expect { Timeout.timeout(3) do
145145
t = Thread.new { subject.wait }
146146
sleep 0.1
147+
# TODO (pitr-ch 15-Oct-2016): https://travis-ci.org/pitr-ch/concurrent-ruby/jobs/167933569
147148
expect(t.status).to eq 'sleep'
148149
subject.synchronize {} # we will deadlock here if #wait doesn't release lock
149150
end }.not_to raise_error

0 commit comments

Comments
 (0)