Skip to content

Commit

Permalink
Merge a2842ce into ecea8e9
Browse files Browse the repository at this point in the history
  • Loading branch information
Donovan Keme committed Jun 11, 2016
2 parents ecea8e9 + a2842ce commit f6648d0
Show file tree
Hide file tree
Showing 13 changed files with 116 additions and 86 deletions.
59 changes: 28 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,40 @@ script: rake ci
cache: bundler
language: ruby
rvm:
- rbx-2
- jruby
- 2.2.2
- 2.2.0
- 2.1.4
- 2.0.0
- 1.9.3
- ruby-head
- jruby-head

- rbx
- jruby-1.7.25
- 2.2.2
- rbx-2
- jruby-9.1.2.0
- 2.1.8
- 2.3.0
- ruby-head
- jruby-head
matrix:
fast_finish: true
allow_failures:
- rvm: 1.9.3
- rvm: ruby-head
- rvm: jruby-head
- env: CELLULOID_BACKPORTED=true
- env: CELLULOID_BACKPORTED=false CELLULOID_LEAKTEST=1
- env: CELLULOID_BACKPORTED=false CELLULOID_TASK_CLASS=Threaded
- env: CELLULOID_BACKPORTED=true CELLULOID_TASK_CLASS=Threaded

- rvm: rbx-2
- rvm: jruby-9.1.2.0
- rvm: 2.1.8
- rvm: 2.3.0
- rvm: ruby-head
- rvm: jruby-head
- env: CELLULOID_BACKPORTED=true
- env: CELLULOID_BACKPORTED=false CELLULOID_LEAKTEST=true
- env: CELLULOID_BACKPORTED=false CELLULOID_TASK_CLASS=Threaded
- env: CELLULOID_BACKPORTED=true CELLULOID_TASK_CLASS=Threaded
env:
global:
- NUMBER_OF_PROCESSORS=4 CELLULOID_CONFIG_FILE=.env-ci
- NUMBER_OF_PROCESSORS=4 CELLULOID_CONFIG_FILE=.env-ci
matrix:
- CELLULOID_BACKPORTED=true
- CELLULOID_BACKPORTED=false
- CELLULOID_BACKPORTED=false CELLULOID_LEAKTEST=1
- CELLULOID_BACKPORTED=false CELLULOID_TASK_CLASS=Threaded
- CELLULOID_BACKPORTED=true CELLULOID_TASK_CLASS=Threaded

- CELLULOID_BACKPORTED=true
- CELLULOID_BACKPORTED=false
- CELLULOID_BACKPORTED=false CELLULOID_LEAKTEST=true
- CELLULOID_BACKPORTED=false CELLULOID_TASK_CLASS=Threaded
- CELLULOID_BACKPORTED=true CELLULOID_TASK_CLASS=Threaded
notifications:
irc: "irc.freenode.org#celluloid"

before_install:
# Only use 1 job until Travis fixes the rbx --jobs issue.
- if [ "$TRAVIS_RUBY_VERSION" == "rbx-2" ] ; then export BUNDLE_JOBS=1 ; else export BUNDLE_JOBS=4; fi

irc: irc.freenode.org#celluloid
slack:
secure: uJ8uoiNgiEDoRewbH6gj9mphUGVDtjXeEy8++vSTQkLqIkkoZ3M+mr0yldL2/ECaG8wHLH2035DHM4d54GyeVEU/8UG80UVAnYTctlzzjn1rfXPfCIsZDXYMUjXe3wvOouN+b4hjiyXe7ZsssdRoeKw6rHIU8/tUHgC3IfZel7s=
sudo: false
install: bundle install --without=development
17 changes: 13 additions & 4 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
0.17.4 (HEAD)
-----
* Clean up and tune-up to become fully compatible with `Rubinius 3.*` ([@digitalextremist])
* Avoid blowing away the actor system & cleaning out hax. ([@ioquatix])
* `README.md` tweaks. Updates to constants. ([@digitalextremist])
* Adding method path in source code to backtrace on arity failures. ([@TiagoCardoso1983])
* Removed faulty conditional "loose threads" test wrapper. ([@digitalextremist])
* Updated `Travis CI` configuration, especially post `Celluloid::Sync` fix. ([@digitalextremist])

0.17.3 (2016-01-18)
-----
* [#701](https://github.com/celluloid/celluloid/pull/701)
Expand Down Expand Up @@ -33,13 +42,13 @@
* [#666](https://github.com/celluloid/celluloid/pull/666)
Don't catch IOError.

0.17.2 (2015-09-30)
0.17.2 (2015-09-30) ([@digitalextremist])
-----
* Revamped test suite, using shared RSpec configuration layer provided by Celluloid itself.
* Updated gem dependencies provided by Celluloid::Sync... extraneous gems removed, or marked as development dependencies.
* Clean up deprecation notes.

0.17.1.2 (2015-08-21)
0.17.1.2 (2015-08-21) ([@digitalextremist])
-----
* Fixes to posted markdown content.
* Pull in new gem dependencies.
Expand All @@ -48,15 +57,15 @@
-----
* Revert "no task to suspend" code from #232.

0.17.1 (2015-08-06)
0.17.1 (2015-08-06) ([@digitalextremist])
-----
* `Celluloid::ActorSystem` moved to `Celluloid::Actor::System`, and from `celluloid/actor_system.rb` to `celluloid/actor/system.rb`
* Added extensible API for defining new SystemEvents, and having them handled... without everyone changing `Actor#handle_system_event`.
* Deprecated Task::TerminatedError & Task::TimeoutError... Consolidated in exceptions.rb, inherited from Exceptions vs. StandardError.
* General round-up of all "errors" emitted throughout Celluloid, to either be derived from `Celluloid::Error` or `Celluloid::Interruption`.
* Added ability to pass a block to `Condition#wait` which runs a `{ |value| ... }` type block if present, once the value is obtained by waiting.

0.17.0 (2015-07-04)
0.17.0 (2015-07-04) ([@digitalextremist])
-----
* Fix $CELLULOID_TEST warnings
* Massive overhaul of test suite, end-to-end.
Expand Down
2 changes: 2 additions & 0 deletions lib/celluloid.rb
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ def future(meth = nil, *args, &block)
require "celluloid/actor/system"
require "celluloid/actor/manager"

require "celluloid/multiplex"

require "celluloid/deprecate" unless $CELLULOID_BACKPORTED == false

$CELLULOID_MONITORING = false
Expand Down
4 changes: 2 additions & 2 deletions lib/celluloid/autostart.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
require "celluloid"

Celluloid.start

unless defined?($CELLULOID_TEST) && $CELLULOID_TEST
Celluloid.register_shutdown
Celluloid.init
end

Celluloid.start
2 changes: 1 addition & 1 deletion lib/celluloid/current.rb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
$CELLULOID_BACKPORTED = false
require "celluloid"
require "celluloid/autostart"
41 changes: 41 additions & 0 deletions lib/celluloid/multiplex.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
class Celluloid::Multiplex

end


=begin
#de https://github.com/celluloid/celluloid/issues/632
# Acts like an array and receives futures. Will yield them as
# they become ready.
class HackedMultiplexer
include Celluloid
include Enumerable
LOOP_BREATHER = 0.0126
def initialize
@not_ready = []
end
def push(obj)
@not_ready.push(obj)
end
alias_method :<<, :push
def each(&blk)
loop do
ready = @not_ready.select { |future| future.ready? }
@not_ready -= ready
ready.each { |future| yield(future) }
break if @not_ready.empty?
end
end
def resolve(arr)
end
end
=end
1 change: 0 additions & 1 deletion lib/celluloid/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
require "rspec/retry"

module Specs
ALLOW_SLOW_MAILBOXES = true # TODO: Remove hax.
CHECK_LOOSE_THREADS = !Nenv.ci? unless defined? CHECK_LOOSE_THREADS
ALLOW_RETRIES = 3 unless defined? ALLOW_RETRIES

Expand Down
2 changes: 1 addition & 1 deletion lib/celluloid/task/fibered.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def create
Thread.current[:celluloid_actor_system] = actor_system
yield
# TODO: Determine why infinite thread leakage happens under jRuby, if `Fiber.yield` is used:
Fiber.yield unless RUBY_PLATFORM == "java"
#de Fiber.yield unless RUBY_PLATFORM == "java"
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/celluloid/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Celluloid
VERSION = "0.17.4"
VERSION = "0.17.5"
end
15 changes: 6 additions & 9 deletions spec/celluloid/calls_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,13 @@
let(:logger) { Specs::FakeLogger.current }

context "when obj does not respond to a method" do
# bypass this until rubinius/rubinius#3373 is resolved
# under Rubinius, `method` calls `inspect` on an object when a method is not found
unless RUBY_ENGINE == "rbx"
it "raises a NoMethodError" do
allow(logger).to receive(:crash).with("Actor crashed!", NoMethodError)

expect do
actor.the_method_that_wasnt_there
end.to raise_exception(NoMethodError)
end
it "raises a NoMethodError" do
allow(logger).to receive(:crash).with("Actor crashed!", NoMethodError)

expect do
actor.the_method_that_wasnt_there
end.to raise_exception(NoMethodError)
end

context "when obj raises during inspect" do
Expand Down
7 changes: 3 additions & 4 deletions spec/celluloid/misc/leak_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require "weakref"

RSpec.describe "Leaks", actor_system: :global, leaktest: true,
skip: !ENV["CELLULOID_LEAKTEST"] && "leak test disabled" do
RSpec.describe "Leaks", actor_system: :global, skip: ENV["CELLULOID_LEAKTEST"] != 'true' do
class LeakActor
include Celluloid

Expand All @@ -24,7 +23,6 @@ def wait_for_release(weak, _what, count=1000)
return true unless weak.weakref_alive?
trash << "*" * step
end

false
end

Expand All @@ -39,7 +37,8 @@ def do_actor(what)
def actor_life(what, &block)
GC.start
weak = do_actor what, &block
expect(wait_for_release(weak, what)).to be_truthy
result = wait_for_release(weak, what)
expect(result).to be_truthy
end

context "celluloid actor" do
Expand Down
14 changes: 14 additions & 0 deletions spec/celluloid/multiplex_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
RSpec.describe Celluloid::Multiplex, actor_system: :global do

context "resolving Futures" do
it "should fire off the resolution block as each Future becomes available" do
fail NotImplementedError
end
end

context "resolving Conditions" do
it "should fire off the resolution block as each Condition becomes available" do
fail NotImplementedError
end
end
end
36 changes: 4 additions & 32 deletions spec/support/loose_threads.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,11 @@ module Specs
class << self
def loose_threads
Thread.list.map do |thread|
next unless thread
next if thread == Thread.current

if RUBY_PLATFORM == "java"
# Avoid disrupting jRuby's "fiber" threads.
name = thread.to_java.getNativeThread.get_name
next if /Fiber/ =~ name
next unless /^Ruby-/ =~ name
backtrace = thread.backtrace # avoid race maybe
next unless backtrace
next if backtrace.empty? # possibly a timer thread
end

if RUBY_ENGINE == "rbx"
# Avoid disrupting Rubinious thread
next if thread.backtrace.first =~ %r{rubysl/timeout/timeout\.rb}

if Specs::ALLOW_SLOW_MAILBOXES
if thread.backtrace.first =~ /wait/
next if thread.backtrace[1] =~ /mailbox\.rb/ && thread.backtrace[1] =~ /check/
end
end
begin
next unless thread && thread.celluloid?
rescue
thread
end

if RUBY_ENGINE == "ruby"
# Sometimes stays
next if thread.backtrace.nil?
next unless thread.backtrace.is_a?(Array)
next if thread.backtrace.empty?
next if thread.backtrace.first =~ /timeout\.rb/
end

thread
end.compact
end

Expand Down

0 comments on commit f6648d0

Please sign in to comment.