Skip to content

Conversation

kobenguyent
Copy link
Collaborator

@kobenguyent kobenguyent commented Sep 30, 2025

Motivation/Description of the PR

  • fix flaky runner tests
  220 passing (4m)
  1 pending
  1 failing

  1) CodeceptJS Timeouts
       should stop test when timeout exceeded:
     Uncaught Error: expect(received).toContain(expected) // indexOf

Expected substring: "Timeout 1s exceeded"
Received string:    "CodeceptJS v3.7.5 #StandWithUkraine
Using test root \"/home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/configs/timeouts\"·
timed out in 2s --·
  ✖ no timeout in 2009ms·
  ✖ timeout in 1 #fourth in 1000ms·
-- FAILURES:·
  1) timed out in 2s
       no timeout:······
  Timeout 2s exceeded (with Before hook)
  TestTimeoutError:·
      at /home/runner/work/CodeceptJS/CodeceptJS/lib/listener/globalTimeout.js:135:17
      at /home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:299:16······
  ◯ File: file:///home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/configs/timeouts/suite_timeout_test.js···
  ◯ Scenario Steps:
  ✖ I.waitForSleep(3000) at Test.<anonymous> (./suite_timeout_test.js:4:5)····
  2) timed out in 2s
       timeout in 1 #fourth:······
  Step I.waitForSleep(3000) timed out after 1s
  StepTimeoutError:·
      at /home/runner/work/CodeceptJS/CodeceptJS/lib/listener/globalTimeout.js:137:15
      at /home/runner/work/CodeceptJS/CodeceptJS/lib/recorder.js:299:16······
  ◯ File: file:///home/runner/work/CodeceptJS/CodeceptJS/test/data/sandbox/configs/timeouts/suite_timeout_test.js···
  ◯ Scenario Steps:
  ✖ I.waitForSleep(3000) at Test.<anonymous> (./suite_timeout_test.js:8:5)·····
  FAIL  | 0 passed, 2 failed   // 3s
Run with --verbose flag to see complete NodeJS stacktrace
"
      at /home/runner/work/CodeceptJS/CodeceptJS/test/runner/timeout_test.js:19:22
      at ChildProcess.exithandler (node:child_process:424:5)
      at ChildProcess.emit (node:events:519:28)
      at maybeClose (node:internal/child_process:1101:16)
      at ChildProcess._handle.onexit (node:internal/child_process:304:5)

Type of change

  • 🔥 Breaking changes
  • 🚀 New functionality
  • 🐛 Bug fix
  • 🧹 Chore
  • 📋 Documentation changes/updates
  • ♨️ Hot fix
  • 🔨 Markdown files fix - not related to source code
  • 💅 Polish code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes flaky unit tests related to timeout handling in CodeceptJS by updating the output filtering logic to properly handle scenario steps output with circle symbols.

  • Updates the stdout write filter to include scenario steps output with circle symbols (◯)
  • Addresses test failures where the expected "Timeout 1s exceeded" substring was not found in the output

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kobenguyent
Copy link
Collaborator Author

Screenshot 3 looks stable after 3 attempts.

@kobenguyent kobenguyent merged commit 2505ac7 into 3.x Sep 30, 2025
22 checks passed
@kobenguyent kobenguyent deleted the kobenguyent-patch-1 branch September 30, 2025 11:20
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

Successfully merging this pull request may close these issues.

2 participants