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

オープン
#5,769 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@DenysKuchma がすでに取り組んでいます。

2026年10月26日 から。

  • #5771 @DenysKuchma による — オープン

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
javascript, node.js, playwright
領域
testing

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
JavaScript
スター
4.2k
フォーク
754
平均マージ
2日 6時間
マージ済み PR(30日)
33

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

codeceptjs/CodeceptJS のほかの issue

codeceptjs/CodeceptJS の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。