<commit_before>Feature: before / after all hook timeouts

  Background:
    Given a file named "features/a.feature" with:
      """
      Feature:
        Scenario:
          Given a passing step
      """
    And a file named "features/step_definitions/steps.js" with:
      """
      import {defineSupportCode} from 'cucumber'

      defineSupportCode(({Given}) => {
        Given(/^a passing step$/, function() {});
      })
      """

  Scenario Outline: slow handler timeout
    Given a file named "features/support/handlers.js" with:
      """
      import {defineSupportCode} from 'cucumber'

      defineSupportCode(({<TYPE>, setDefaultTimeout}) => {
        setDefaultTimeout(500)

        <TYPE>(function(callback) {
          setTimeout(callback, 1000)
        })
      })
      """
    When I run cucumber.js
    Then it fails
    And the error output contains the text snippets:
      | a handler errored, process exiting        |
      | function timed out after 500 milliseconds |
      | features/support/handlers.js:6            |

    Examples:
      | TYPE      |
      | BeforeAll |
      | AfterAll  |

  Scenario Outline: slow handler can increase their timeout
    Given a file named "features/supports/handlers.js" with:
      """
      import {defineSupportCode} from 'cucumber'

      defineSupportCode(({<TYPE>, setDefaultTimeout}) => {
        setDefaultTimeout(500)

        <TYPE>({timeout: 1500}, function(callback) {
          setTimeout(callback, 1000)<commit_msg>Scenario Outline name rename: pluralize word (#903)<commit_after>Feature: before / after all hook timeouts

  Background:
    Given a file named "features/a.feature" with:
      """
      Feature:
        Scenario:
          Given a passing step
      """
    And a file named "features/step_definitions/steps.js" with:
      """
      import {defineSupportCode} from 'cucumber'

      defineSupportCode(({Given}) => {
        Given(/^a passing step$/, function() {});
      })
      """

  Scenario Outline: slow handler timeout
    Given a file named "features/support/handlers.js" with:
      """
      import {defineSupportCode} from 'cucumber'

      defineSupportCode(({<TYPE>, setDefaultTimeout}) => {
        setDefaultTimeout(500)

        <TYPE>(function(callback) {
          setTimeout(callback, 1000)
        })
      })
      """
    When I run cucumber.js
    Then it fails
    And the error output contains the text snippets:
      | a handler errored, process exiting        |
      | function timed out after 500 milliseconds |
      | features/support/handlers.js:6            |

    Examples:
      | TYPE      |
      | BeforeAll |
      | AfterAll  |

  Scenario Outline: slow handlers can increase their timeout
    Given a file named "features/supports/handlers.js" with:
      """
      import {defineSupportCode} from 'cucumber'

      defineSupportCode(({<TYPE>, setDefaultTimeout}) => {
        setDefaultTimeout(500)

        <TYPE>({timeout: 1500}, function(callback) {
          setTimeout(callback, 1000)
{'fraction_non_alphanumeric': 0.10682492581602374, 'fraction_numerical': 0.015496208374546653, 'mean_word_length': 2.3450937155457554, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 17, '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': '7550297', 'n_tokens_mistral': 894, 'n_tokens_neox': 820, 'n_words': 229}