<commit_before>Thread.abort_on_exception = true
require 'helper'

class TestConnectionPoolTimedStack < Minitest::Test

  def setup
    @stack = ConnectionPool::TimedStack.new { Object.new }
  end

  def test_empty_eh
    assert_empty @stack

    @stack.push Object.new

    refute_empty @stack
  end

  def test_pop
    e = assert_raises Timeout::Error do
      @stack.pop 0.0000001
    end

    assert_match %r%Waited [\de.-]+ sec%, e.message
  end

  def test_push
    assert_empty @stack

    @stack.push Object.new

    refute_empty @stack
  end<commit_msg>Test TimedStack#length<commit_after>Thread.abort_on_exception = true
require 'helper'

class TestConnectionPoolTimedStack < Minitest::Test

  def setup
    @stack = ConnectionPool::TimedStack.new { Object.new }
  end

  def test_empty_eh
    assert_empty @stack

    @stack.push Object.new

    refute_empty @stack
  end

  def test_length
    assert_equal 0, @stack.length

    @stack.push Object.new

    assert_equal 1, @stack.length
  end

  def test_pop
    e = assert_raises Timeout::Error do
      @stack.pop 0.0000001
    end

    assert_match %r%Waited [\de.-]+ sec%, e.message
  end

  def test_push
    assert_empty @stack

    @stack.push Object.new

    refute_empty @stack
  end
{'fraction_non_alphanumeric': 0.07980845969672785, 'fraction_numerical': 0.014365522745411013, 'mean_word_length': 3.0714285714285716, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '7046252', 'n_tokens_mistral': 449, 'n_tokens_neox': 415, 'n_words': 103}