<commit_before>describe DCell::Node do
  def wait_for_actor(id)
    30.times do
      node = DCell::Node[id]
      begin
        return node if node and node.all
      rescue Celluloid::DeadActorError
      end
      sleep 1
    end
  end

  before :each do
    @node = wait_for_actor TEST_NODE[:id]
    @node.id.should == TEST_NODE[:id]
  end

  it "finds all available nodes" do
    nodes = DCell::Node.all
    nodes.should include(DCell.me)
  end

  it "finds remote actors" do
    actor = @node[:test_actor]
    actor.value.should == 42
  end

  it "lists remote actors" do
    @node.actors.should include :test_actor
    @node.all.should include :test_actor
  end

  context :crashing, :pending => RUBY_ENGINE=="jruby" do
    it "retries remote actor lookup" do
      @node[:test_actor].suicide 3<commit_msg>spec:node crashing: handle Celluloid::Task::TerminatedError while waiting for the remote node<commit_after>describe DCell::Node do
  def wait_for_actor(id)
    30.times do
      node = DCell::Node[id]
      begin
        return node if node and node.all
      rescue Celluloid::DeadActorError, Celluloid::Task::TerminatedError
      end
      sleep 1
    end
  end

  before :each do
    @node = wait_for_actor TEST_NODE[:id]
    @node.id.should == TEST_NODE[:id]
  end

  it "finds all available nodes" do
    nodes = DCell::Node.all
    nodes.should include(DCell.me)
  end

  it "finds remote actors" do
    actor = @node[:test_actor]
    actor.value.should == 42
  end

  it "lists remote actors" do
    @node.actors.should include :test_actor
    @node.all.should include :test_actor
  end

  context :crashing, :pending => RUBY_ENGINE=="jruby" do
    it "retries remote actor lookup" do
      @node[:test_actor].suicide 3
{'fraction_non_alphanumeric': 0.09482758620689655, 'fraction_numerical': 0.006896551724137931, 'mean_word_length': 2.9839816933638446, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2191481', 'n_tokens_mistral': 600, 'n_tokens_neox': 570, 'n_words': 165}