You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildr.apache.org by do...@apache.org on 2012/05/20 10:02:12 UTC
svn commit: r1340633 - /buildr/trunk/spec/core/cc_spec.rb
Author: donaldp
Date: Sun May 20 08:02:11 2012
New Revision: 1340633
URL: http://svn.apache.org/viewvc?rev=1340633&view=rev
Log:
Attempt to get the tests passing more successfully across a range of platforms by increasing the length of sleeps. One ugly way to address the indeterminacy
Modified:
buildr/trunk/spec/core/cc_spec.rb
Modified: buildr/trunk/spec/core/cc_spec.rb
URL: http://svn.apache.org/viewvc/buildr/trunk/spec/core/cc_spec.rb?rev=1340633&r1=1340632&r2=1340633&view=diff
==============================================================================
--- buildr/trunk/spec/core/cc_spec.rb (original)
+++ buildr/trunk/spec/core/cc_spec.rb Sun May 20 08:02:11 2012
@@ -92,21 +92,29 @@ describe Buildr::CCTask do
foo.cc.invoke
rescue => e
p "unexpected exception #{e.inspect}"
- p e.backtrace.join("\n").inspect
+ p e.backtrace.join("\n")
end
end
- sleep 1
+ #Ick! Try to get the sleeping enough on each platform that the tests reliably pass
+ sleep 1 if RUBY_VERSION >= '1.9' && !RUBY_PLATFORM[/java/]
+ sleep 5 if RUBY_VERSION >= '1.8.7' && !RUBY_PLATFORM[/java/]
+ sleep 1 if RUBY_PLATFORM[/java/]
foo.compile.run_count.should == 1
foo.test.compile.run_count.should == 1
foo.resources.run_count.should == 1
- sleep 1 # Wait one sec as the timestamp needs to be different.
+ # Wait some time as the timestamp needs to be different on files.
+ sleep 3 if Buildr::Util.win_os?
+ sleep 1 unless Buildr::Util.win_os?
touch File.join(Dir.pwd, 'src/main/java/Example.java')
- sleep 1
+ #Ick! Try to get the sleeping enough on each platform that the tests reliably pass
+ sleep 1 if RUBY_VERSION >= '1.9' && !RUBY_PLATFORM[/java/]
+ sleep 5 if RUBY_VERSION >= '1.8.7' && !RUBY_PLATFORM[/java/]
+ sleep 1 if RUBY_PLATFORM[/java/]
foo.compile.run_count.should == 2
foo.test.compile.run_count.should == 2