Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consecutive Celluloid.boot / Celluloid.shutdown calls throw Celluloid::Supervision::Configuration::Error::InvalidSupervisor #758

Closed
dlau opened this issue May 3, 2017 · 2 comments

Comments

@dlau
Copy link

dlau commented May 3, 2017

Hi,

In specs, I am calling Celluloid.boot and Celluloid.shutdown before and after each block evaluation, per recommended usage in the wiki.

Gemfile:

# frozen_string_literal: true
source "https://rubygems.org"

gem "celluloid", "0.18.0.pre"
gem "rspec"

Here is a stripped down test file:

require 'rspec'
require 'celluloid/current'

RSpec.describe 'foo' do
  before(:each) do
    Celluloid.boot
  end

  after(:each) do
    Celluloid.shutdown
  end

  it '1' do
    expect(1).to eq(1)
  end
  it '2' do
    expect(2).to eq(2)
  end
end

When run, the output looks like this:

~/dev/celluloid-test rake                                                                                                                                    
Failures:

  1) foo 2
     Failure/Error: Celluloid.boot

     Celluloid::Supervision::Configuration::Error::InvalidSupervisor:
       Celluloid::Supervision::Configuration::Error::InvalidSupervisor
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-supervision-0.20.6/lib/celluloid/supervision/configuration.rb:58:in `provider'
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-supervision-0.20.6/lib/celluloid/supervision/configuration.rb:52:in `provider'
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-supervision-0.20.6/lib/celluloid/supervision/configuration.rb:65:in `block in deploy'
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-supervision-0.20.6/lib/celluloid/supervision/configuration.rb:64:in `each'
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-supervision-0.20.6/lib/celluloid/supervision/configuration.rb:64:in `deploy'
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-0.18.0.pre/lib/celluloid/actor/system.rb:61:in `block in start'
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-0.18.0.pre/lib/celluloid/actor/system.rb:70:in `within'
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-0.18.0.pre/lib/celluloid/actor/system.rb:59:in `start'
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-0.18.0.pre/lib/celluloid.rb:155:in `start'
     # /Users/daryllau/.rvm/gems/ruby-2.3.1/gems/celluloid-0.18.0.pre/lib/celluloid.rb:147:in `boot'
     # ./spec/test_spec.rb:11:in `block (2 levels) in <top (required)>'

Finished in 0.00671 seconds (files took 0.1773 seconds to load)
2 examples, 1 failure

Failed examples:

rspec ./spec/test_spec.rb:21 # foo 2

This is causing most complex test cases to fail in a more complex test case in our fork of celluloid-eventsource

@florin555
Copy link

A quick and dirty fix that I found to work is:

Celluloid.shutdown
Celluloid.instance_variable_set(:@actor_system, nil)
Celluloid.boot

@tarcieri
Copy link
Member

Seems like this is a bug in Celluloid.shutdown then and it should be terminating and clearing @actor_system

tarcieri added a commit that referenced this issue Sep 12, 2017
netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Jan 10, 2021
0.18.0 (2020-12-05)

#804 Remove deprecation warnings

#802 Remove lattice link itself.

#797 Update Ruby versions in CI script

#801 Associate Open Collective sponsorship option

#800 Streamline README

#799 Update links, add diagram preview.

#796 Create Class Diagram in Draw.io

#798 Pertinent Newsflash

#792 CI: 2.5.5, 2.6.2

#788 Travis: Include Ruby 2.5, 2.6

#787 Travis config: drop old configuration sudo: false

#786 Travis: use jruby-9.2.5.0

#783 v0.18.0.pre2

#782 Merge 'celluloid-supervision' back into the tree

#781 .gitmodules: No longer used

#780 README.md: Link to unmaintained issue

#778 README.md: Add "maintained: no! (as of 2016)" badge

#777 gemspec: Metadata with supported links

#776 Travis: use jruby-9.2.0.0

#775 Travis: jruby-9.1.17.0

#769 Travis: jruby-9.1.15.0

#768 Travis: use latest JRuby

#767 CHANGES: Add GitHub compare link on each heading

#766 Fix celluloid/celluloid#758

#765 Travis: jruby-9.1.13.0

#761 Travis: jruby-9.1.12.0

#760 Travis: jruby-9.1.10.0

#759 Travis: jruby-9.1.9.0

#757 parameterize error message so old and new Rubies match text

#756 Travis: latest stable rubies

#754 README: Fix badge rendering in Markdown

#753 Travis: use jruby-9.1.8.0

#752 Misspellings

#749 Return false from Celluloid.running? if Celluloid.boot hasn't been called

#751 Travis: Use JRuby 9.1.7.0

#740 Global variables: stop the bleeding

#739 Remove hacks around old MRIs, JRuby, and rbx

#738 Update to RuboCop 0.45.0 (with new rubocop.yml policy)

#737 Simplify dependencies: merge 'essentials' and 'culture' repos

#736 Remove $CELLULOID_BACKPORTED and $CELLULOID_MANAGED

#735 Require Ruby 2.2.6+

#729 Remove mysterious Fiber.yield

#721 Instruction for cloning Celluloid via github

#715 fix error response reference in Future#cancel

#712 Add RBX-3 to the build

#711 Added bundler cache

#709 Fix autostart. Fixes celluloid/celluloid#698

#705 Adding method source code path to backtrace
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants