<commit_before>require 'helper'
require 'jobs/retry_job'
require 'byebug'

class ExceptionsTest < ActiveSupport::TestCase
  setup do
    JobBuffer.clear
  end

  test "successfully retry job throwing exception against defaults" do
    RetryJob.perform_later 'DefaultsError', 5

    assert_equal [
      "Raised DefaultsError for the 1st time",
      "Raised DefaultsError for the 2nd time",
      "Raised DefaultsError for the 3rd time",
      "Raised DefaultsError for the 4th time",
      "Successfully completed job" ], JobBuffer.values
  end

  test "successfully retry job throwing exception against higher limit" do
    RetryJob.perform_later 'ShortWaitTenAttemptsError', 9
    assert_equal 9, JobBuffer.values.count
  end<commit_msg>Not needed<commit_after>require 'helper'
require 'jobs/retry_job'

class ExceptionsTest < ActiveSupport::TestCase
  setup do
    JobBuffer.clear
  end

  test "successfully retry job throwing exception against defaults" do
    RetryJob.perform_later 'DefaultsError', 5

    assert_equal [
      "Raised DefaultsError for the 1st time",
      "Raised DefaultsError for the 2nd time",
      "Raised DefaultsError for the 3rd time",
      "Raised DefaultsError for the 4th time",
      "Successfully completed job" ], JobBuffer.values
  end

  test "successfully retry job throwing exception against higher limit" do
    RetryJob.perform_later 'ShortWaitTenAttemptsError', 9
    assert_equal 9, JobBuffer.values.count
  end
{'fraction_non_alphanumeric': 0.06301369863013699, 'fraction_numerical': 0.009589041095890411, 'mean_word_length': 3.9693877551020407, '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': '5549477', 'n_tokens_mistral': 446, 'n_tokens_neox': 410, 'n_words': 142}