Skip to content

Commit dcac23a

Browse files
committed
Merge pull request #325 from ruby-concurrency/fix-build-tests
Fix build tests
2 parents 0e3fdc4 + 12b1ab1 commit dcac23a

11 files changed

+54
-411
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ ext/**/*.bundle
3535
ext/**/*.so
3636
ext/**/*.jar
3737
pkg
38+
*.csv

build-tests/atomic_reference_builds_spec.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,62 +23,62 @@ def atomic_reference_test(clazz, opts = {})
2323
stats
2424
end
2525

26-
describe Concurrent::Atomic do
26+
describe Concurrent::AtomicReference do
2727

2828
let!(:threads) { 10 }
2929
let!(:tests) { 1000 }
3030

31-
describe Concurrent::MutexAtomic do
31+
describe Concurrent::MutexAtomicReference do
3232

3333
specify 'is defined' do
34-
expect(defined?(Concurrent::MutexAtomic)).to be_truthy
34+
expect(defined?(Concurrent::MutexAtomicReference)).to be_truthy
3535
end
3636

3737
specify 'runs the benchmarks' do
38-
stats = atomic_reference_test('MutexAtomic', threads: threads, tests: tests)
38+
stats = atomic_reference_test('MutexAtomicReference', threads: threads, tests: tests)
3939
expect(stats).to be_benchmark_results
4040
end
4141
end
4242

4343
if jruby? && 'JRUBY' == ENV['TEST_PLATFORM'].strip
4444

45-
describe Concurrent::JavaAtomic do
45+
describe Concurrent::JavaAtomicReference do
4646

47-
specify 'Concurrent::JavaAtomic is defined' do
48-
expect(defined?(Concurrent::JavaAtomic)).to be_truthy
47+
specify 'Concurrent::JavaAtomicReference is defined' do
48+
expect(defined?(Concurrent::JavaAtomicReference)).to be_truthy
4949
end
5050

5151
specify 'runs the benchmarks' do
52-
stats = atomic_reference_test('JavaAtomic', threads: threads, tests: tests)
52+
stats = atomic_reference_test('JavaAtomicReference', threads: threads, tests: tests)
5353
expect(stats).to be_benchmark_results
5454
end
5555
end
5656

5757
else
5858

59-
specify 'Concurrent::JavaAtomic is not defined' do
60-
expect(defined?(Concurrent::JavaAtomic)).to be_falsey
59+
specify 'Concurrent::JavaAtomicReference is not defined' do
60+
expect(defined?(Concurrent::JavaAtomicReference)).to be_falsey
6161
end
6262
end
6363

6464
if 'EXT' == ENV['TEST_PLATFORM'].strip
6565

66-
describe Concurrent::CAtomic do
66+
describe Concurrent::CAtomicReference do
6767

68-
specify 'Concurrent::CAtomic is defined' do
69-
expect(defined?(Concurrent::CAtomic)).to be_truthy
68+
specify 'Concurrent::CAtomicReference is defined' do
69+
expect(defined?(Concurrent::CAtomicReference)).to be_truthy
7070
end
7171

7272
specify 'runs the benchmarks' do
73-
stats = atomic_reference_test('CAtomic', threads: threads, tests: tests)
73+
stats = atomic_reference_test('CAtomicReference', threads: threads, tests: tests)
7474
expect(stats).to be_benchmark_results
7575
end
7676
end
7777

7878
else
7979

80-
specify 'Concurrent::CAtomic is not defined' do
81-
expect(defined?(Concurrent::CAtomic)).to be_falsey
80+
specify 'Concurrent::CAtomicReference is not defined' do
81+
expect(defined?(Concurrent::CAtomicReference)).to be_falsey
8282
end
8383
end
8484
end

build-tests/runner.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ def run_test_suite(files, ext, platform = '')
6969

7070
test_platform = if ext
7171
'EXT'
72-
elsif jruby?(platform)
72+
elsif jruby?
7373
'JRUBY'
7474
else
7575
'RUBY'
7676
end
7777

78-
cmd = if jruby?(platform)
78+
cmd = if jruby?
7979
install_java_gem_command
8080
else
8181
install_gems_command(ext, platform)
@@ -102,10 +102,7 @@ def run_test_suite(files, ext, platform = '')
102102
puts SUITE_BREAK
103103

104104
run_test_suite(TEST_FILES, false)
105-
if jruby?
106-
puts SUITE_BREAK
107-
run_test_suite(TEST_FILES, false, 'jruby')
108-
elsif mri?
105+
if mri?
109106
if ! windows?
110107
puts SUITE_BREAK
111108
run_test_suite(TEST_FILES, true)

examples/actor_stress_test.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ def test(threads, loops)
8484
expect(queue.pop).to eq 3
8585

8686
actor << :terminate!
87-
expect(actor.ask(:blow_up).wait).to be_rejected
87+
#expect(actor.ask(:blow_up).wait).to be_rejected
88+
expect(actor.ask(:blow_up).wait).to be_failed
8889
terminate_actors(actor, child)
8990
end
9091
end

examples/at_exit_tester.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
require 'concurrent'
66

77
# with this, a JRuby process will never exit
8-
Concurrent.disable_auto_termination_of_all_executors!
8+
Concurrent.disable_executor_auto_termination!
99

1010
SIZE = 5
1111

examples/atomic_example.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
$: << File.expand_path('../../lib', __FILE__)
44

5-
require 'concurrent/atomic'
5+
require 'concurrent/atomics'
66

7-
my_atomic = Concurrent::Atomic.new(0)
7+
my_atomic = Concurrent::AtomicReference.new(0)
88
my_atomic.update {|v| v + 1}
99
puts "new value: #{my_atomic.value}"
1010

examples/bench_atomic.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
require 'rbconfig'
77
require 'thread'
88

9-
require 'concurrent/atomic'
9+
require 'concurrent/atomics'
1010

11-
if RUBY_PLATFORM != 'java' && ! defined? Concurrent::CAtomic
11+
if RUBY_PLATFORM != 'java' && ! defined? Concurrent::CAtomicReference
1212
warn "[WARN] C extensions not loaded!"
1313
end
1414

@@ -24,10 +24,10 @@
2424

2525
# list of platform-specific implementations
2626
ATOMICS = [
27-
'MutexAtomic',
28-
'CAtomic',
29-
'JavaAtomic',
30-
'RbxAtomic',
27+
'MutexAtomicReference',
28+
'CAtomicReference',
29+
'JavaAtomicReference',
30+
'RbxAtomicReference',
3131
]
3232

3333
puts "Testing with #{RbConfig::CONFIG['ruby_install_name']} #{RUBY_VERSION}"

examples/bench_atomic_1.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
require 'thread'
77
require 'benchmark'
88

9-
require 'concurrent/atomic'
9+
require 'concurrent/atomics'
1010

11-
unless defined? Concurrent::CAtomic
11+
unless defined? Concurrent::CAtomicReference
1212
warn "[ERROR] C extensions not loaded!"
1313
exit(1)
1414
end

examples/benchmark_new_futures.rb

100644100755
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
#!/usr/bin/env ruby
2+
3+
$: << File.expand_path('../../lib', __FILE__)
4+
15
require 'benchmark/ips'
26
require 'concurrent'
37
require 'concurrent-edge'

0 commit comments

Comments
 (0)