Codebase list ruby-parallel / 2e9dc68
Disable running upstream test suite Closes: #905648, #1019646, #1017218 Antonio Terceiro 1 year, 2 months ago
2 changed file(s) with 23 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
00 require 'gem2deb/rake/spectask'
11
2 # Upstream recommended to disable running the test suite, and everytime we try
3 # to run it again, sooner or later we get FTBFS bugs due to random failures.
4 # Instead of running the upstream test suite, let's run just some very basic
5 # smoke tests of our own.
6 #
7 # Links:
8 # https://github.com/grosser/parallel/issues/227
9 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=905648
10 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1019646
11 # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1017218
212 Gem2Deb::Rake::RSpecTask.new do |spec|
3 spec.pattern = './spec/**/*_spec.rb'
13 spec.pattern = 'debian/tests/*_spec.rb'
414 end
5
6 task :default
7 require "parallel"
8 puts "can load parallel gem"
9
0 require 'etc'
1 require 'benchmark'
2 require 'parallel'
3
4 describe 'Parallel' do
5 it 'works for a simple case' do
6 skip if Etc.nprocessors < 2
7 sequential = Benchmark.measure { (0..100).each { sleep 0.01} }
8 parallel = Benchmark.measure { Parallel.each(0..100) { sleep 0.01} }
9 expect(parallel.real).to be < sequential.real
10 end
11 end