run-workers --by pool: failing Before after auth `loginAs()` hangs the worker; remaining tests never run

Đang mở
#5,769 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@DenysKuchma đang làm issue này rồi.

Từ ngày 26/10/2026.

  • #5771 của @DenysKuchma — đang mở

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js, playwright
Lĩnh vực
testing

Hướng nghiên cứu

Start by comparing codeceptjs run-workers 1 --by pool with the plain codeceptjs run using the supplied 12-suite reproduction, then inspect the worker and pool execution paths implicated by the difference. Reproduce the unhandled promise rejection after loginAs() in Before and trace why it multiplies. Done when the worker completes the remaining suites and reports their results without the rejection cycle; linked pull request #5771 is already open.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

With run-workers --by pool, if a Before that calls loginAs() (auth plugin) fails after the login, the worker starts throwing UNHANDLED REJECTION: Chaining cycle detected for promise. The count grows with every such failure until the worker hangs or runs out of memory. Tests left in the pool never run, and the summary says OK | 0 passed. Plain codeceptjs run with the same tests works fine.

CodeceptJS 4.2.0 and 4.2.2, Node 22, Playwright.

Repro

codecept.conf.js:

export const config = {
  tests: './tests/*.test.js',
  output: './output',
  helpers: { Playwright: { url: 'http://127.0.0.1:8765', show: false } },
  plugins: {
    auth: {
      enabled: true,
      inject: 'loginAs',
      users: {
        user: {
          login: I => {
            I.amOnPage('/')
            I.setCookie({ name: 'session', value: '1', domain: '127.0.0.1', path: '/' })
          },
          check: I => I.amOnPage('/'),
        },
      },
    },
  },
}

tests/suite_01.test.js … suite_12.test.js (12 copies):

Feature('Suite 01')

let calls = 0

Before(async ({ I, loginAs }) => {
  calls++
  loginAs('user')
  I.amOnPage('/')
  if (calls >= 2) I.waitForElement('#missing', 1)
  await I.grabCurrentUrl()
})

Scenario('test 1', ({ I }) => I.amOnPage('/'))

Scenario('test 2', ({ I }) => I.amOnPage('/'))
python3 -m http.server 8765 --bind 127.0.0.1
npx codeceptjs run-workers 1 --by pool

Result

  • Rejections per suite: 1, 2, 5, 16, 65, 326, 1957, 13700, 109601, 986410, then JS heap out of memory. Suites 11–12 never run.
  • codeceptjs run: no rejections, all 12 suites run.
  • loginAs() moved from Before into the Scenarios: no rejections.

Related: #5207.

Ngôn ngữ chính
JavaScript
Star
4.2k
Fork
754
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
28

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của codeceptjs/CodeceptJS

Tất cả issue của codeceptjs/CodeceptJS

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.