Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 81472e5c0598
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 156ce20eb67f
Choose a head ref
  • 6 commits
  • 12 files changed
  • 1 contributor

Commits on Jun 19, 2016

  1. Remove useless GC.start

    eregon committed Jun 19, 2016
    Copy the full SHA
    c0eed59 View commit details
  2. Copy the full SHA
    7e7f233 View commit details
  3. [Truffle] Simplify the slow specs tagger by looking at ARGV.

    * Extend it to cover more slow methods.
    eregon committed Jun 19, 2016
    Copy the full SHA
    1083d4b View commit details
  4. [Truffle] New slow tags.

    eregon committed Jun 19, 2016
    Copy the full SHA
    eb5d06f View commit details
  5. Copy the full SHA
    55f8377 View commit details
  6. [Truffle] New slow tags.

    eregon committed Jun 19, 2016
    Copy the full SHA
    156ce20 View commit details
26 changes: 10 additions & 16 deletions spec/ruby/library/weakref/send_spec.rb
Original file line number Diff line number Diff line change
@@ -2,26 +2,20 @@
require 'weakref'

describe "WeakRef#__send__" do
after :all do
GC.start
end

module WeakRefSpecs
def self.delegated_method
:result
end

def self.protected_method
:result
end
class << self
def delegated_method
:result
end

def protected_method
:result
end
protected :protected_method
end

def self.private_method
:result
end
class << self
def private_method
:result
end
private :private_method
end
end
7 changes: 4 additions & 3 deletions spec/truffle/specs/truffle/gc/count_spec.rb
Original file line number Diff line number Diff line change
@@ -16,9 +16,10 @@

it "increases as collections are run" do
count_before = Truffle::GC.count
escape = []
100_000.times do
escape << Time.now.to_s
i = 0
while Truffle::GC.count <= count_before and i < 10
GC.start
i += 1
end
Truffle::GC.count.should > count_before
end
7 changes: 4 additions & 3 deletions spec/truffle/specs/truffle/gc/time_spec.rb
Original file line number Diff line number Diff line change
@@ -16,9 +16,10 @@

it "increases as collections are run" do
time_before = Truffle::GC.time
escape = []
100_000.times do
escape << Time.now.to_s
i = 0
while Truffle::GC.time <= time_before and i < 10
GC.start
i += 1
end
Truffle::GC.time.should > time_before
end
2 changes: 2 additions & 0 deletions spec/truffle/tags/core/kernel/system_tags.txt
Original file line number Diff line number Diff line change
@@ -14,3 +14,5 @@ fails:Kernel.system executes with `sh` if the command contains shell characters
fails:Kernel.system ignores SHELL env var and always uses `sh`
fails:Kernel.system expands shell variables when given a single string argument
fails:Kernel.system does not expand shell variables when given multiples arguments
slow:Kernel#system returns true when the command exits with a zero exit status
slow:Kernel.system returns true when the command exits with a zero exit status
22 changes: 22 additions & 0 deletions spec/truffle/tags/core/objectspace/each_object_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
fails:ObjectSpace.each_object doesn't find an object stored in a WeakRef that should have been cleared
fails:ObjectSpace.each_object walks a class and its normal descendants when passed the class's singleton class
fails:ObjectSpace.each_object on singleton classes walks singleton classes
slow:ObjectSpace.each_object calls the block once for each living, non-immediate object in the Ruby process
slow:ObjectSpace.each_object calls the block once for each class, module in the Ruby process
slow:ObjectSpace.each_object returns an enumerator if not given a block
slow:ObjectSpace.each_object finds an object stored in a global variable
slow:ObjectSpace.each_object finds an object stored in a top-level constant
slow:ObjectSpace.each_object finds an object stored in a second-level constant
slow:ObjectSpace.each_object finds an object stored in a local variable
slow:ObjectSpace.each_object finds an object stored in a local variable captured in a block explicitly
slow:ObjectSpace.each_object finds an object stored in a local variable captured in a block implicitly
slow:ObjectSpace.each_object finds an object stored in a local variable captured in by a method defined with a block
slow:ObjectSpace.each_object finds an object stored in a local variable captured in a Proc#binding
slow:ObjectSpace.each_object finds an object stored in a local variable captured in a Kernel#binding
slow:ObjectSpace.each_object finds an object stored in a local variable set in a binding manually
slow:ObjectSpace.each_object finds an object stored in an array
slow:ObjectSpace.each_object finds an object stored in a hash key
slow:ObjectSpace.each_object finds an object stored in a hash value
slow:ObjectSpace.each_object finds an object stored in an instance variable
slow:ObjectSpace.each_object finds an object stored in a thread local
slow:ObjectSpace.each_object finds an object stored in a fiber local
slow:ObjectSpace.each_object finds an object captured in an at_exit handler
slow:ObjectSpace.each_object finds an object captured in finalizer
slow:ObjectSpace.each_object on singleton classes does not walk hidden metaclasses
1 change: 1 addition & 0 deletions spec/truffle/tags/language/predefined_tags.txt
Original file line number Diff line number Diff line change
@@ -5,3 +5,4 @@ slow:The predefined global constant STDOUT has the encodings set by #set_encodin
slow:The predefined global constant ARGV contains Strings encoded in locale Encoding
linux:Global variable $0 actually sets the program name
slow:Global variable $0 is the path given as the main script and the same as __FILE__
slow:Global variable $? is thread-local
4 changes: 4 additions & 0 deletions spec/truffle/tags/library/timeout/timeout_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
slow:Timeout.timeout raises Timeout::Error when it times out with no specified error type
slow:Timeout.timeout raises specified error type when it times out
slow:Timeout.timeout does not wait too long
slow:Timeout.timeout returns back the last value in the block
2 changes: 2 additions & 0 deletions spec/truffle/tags/library/zlib/deflate/deflate_tags.txt
Original file line number Diff line number Diff line change
@@ -3,3 +3,5 @@ fails(OOM):Zlib::Deflate#deflate with break deflates only first chunk
fails(OOM):Zlib::Deflate#deflate with break deflates chunked data with final chunk
fails(OOM):Zlib::Deflate#deflate with break deflates chunked data without errors
fails:Zlib::Deflate.deflate deflates chunked data
slow:Zlib::Deflate#deflate deflates lots of data
slow:Zlib::Deflate.deflate deflates lots of data
2 changes: 2 additions & 0 deletions spec/truffle/tags/library/zlib/inflate/inflate_tags.txt
Original file line number Diff line number Diff line change
@@ -3,3 +3,5 @@ fails:Zlib::Inflate.inflate properly handles excessive data, byte-by-byte
fails:Zlib::Inflate#inflate without break inflates chunked data
slow:Zlib::Inflate#inflate with break
slow:Zlib::Inflate#inflate without break
slow:Zlib::Inflate#inflate inflates lots of data
slow:Zlib::Inflate.inflate inflates lots of data
1 change: 1 addition & 0 deletions spec/truffle/tags/truffle/gc/count_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
slow:Truffle::GC.count increases as collections are run
1 change: 1 addition & 0 deletions spec/truffle/tags/truffle/gc/time_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
slow:Truffle::GC.time increases as collections are run
26 changes: 19 additions & 7 deletions spec/truffle/truffle.mspec
Original file line number Diff line number Diff line change
@@ -128,7 +128,8 @@ class MSpecScript
set :files, get(:language) + get(:core) + get(:library) + get(:truffle)
end

if respond_to?(:ruby_exe)
is_child_process = respond_to?(:ruby_exe)
if i = ARGV.index('slow') and ARGV[i-1] == '--excl-tag' and is_child_process
class SlowSpecsTagger
def initialize
MSpec.register :exception, self
@@ -145,14 +146,25 @@ if respond_to?(:ruby_exe)
class SlowSpecException < Exception
end

class ::Object
%w[ruby_exe ruby_cmd].each do |meth|
alias_method "old_#{meth}", meth
define_method(meth) do |*args, &block|
if (MSpecScript.get(:xtags) || []).include? 'slow'
require 'timeout'

slow_methods = [
[Object, [:ruby_exe, :ruby_cmd]],
[ObjectSpace.singleton_class, [:each_object]],
[GC.singleton_class, [:start]],
[Kernel, [:system]],
[Kernel.singleton_class, [:system]],
[Timeout.singleton_class, [:timeout]],
]

slow_methods.each do |klass, meths|
klass.class_exec do
meths.each do |meth|
define_method(meth) do |*args, &block|
raise SlowSpecException, "Was tagged as slow as it uses #{meth}(). Rerun specs."
end
old_ruby_exe(*args, &block)
# Keep visibility of Kernel#system
private meth if klass == Kernel and meth == :system
end
end
end