Feature config override (specifically 'restart') causes process to hang after suite
@DenysKuchma がすでに取り組んでいます。
2026年1月8日 から。
評価
この issue はまだ評価されていません。
説明
Description
We have a codebase where for all of the tests, we have restart set as false inside of codecept.conf.js. However we have 1 Feature where we would like to have restart set to session/keep. The problem is that when overriding config on the feature with
Feature('blabla').config({ restart: 'session' })
we run into the problem that suite hangs up after it completes, leaving browser open and just never finishing. This causes it to label it as failed due to timeout on our CI pipeline.
This problem does not occur if restart: 'session' is set in codecept.conf.js. Setting config on each Scenario also doesn't work, because config gets reverted between them, which causes the browser to close after first Scenario and not reopening for the second one.
How it should work
After the suite completes, codecept process shuts down as expected.
Example
codecept.conf.js:
const { setHeadlessWhen, setCommonPlugins } = require('@codeceptjs/configure')
// turn on headless mode when running with HEADLESS=true environment variable
// export HEADLESS=true && npx codeceptjs run
setHeadlessWhen(process.env.HEADLESS)
// enable all common plugins https://github.com/codeceptjs/configure#setcommonplugins
setCommonPlugins()
/** @type {CodeceptJS.MainConfig} */
exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
Playwright: {
browser: 'chromium',
url: 'http://google.com',
show: true,
keepBrowserState: false, // No influence when restart: true
keepCookies: false, // No influence when restart: true
restart: true
},
FileSystem: {}
},
name: 'ccjs'
}
Suite:
Feature('Config hangs').config({
restart: 'session'
})
Scenario('do something 1', ({ I }) => {
I.amOnPage('https://codecept.io/quickstart/')
})
Scenario('do something 2', ({ I }) => {
I.waitForText('Quickstart')
})
Scenario('do something 3', ({ I }) => {
I.see('If you prefer not to use Playwright')
})
Output:
~hxllv~ ~/ccjs npx codeceptjs run featureConfigHang.js --verbose
***************************************
nodeInfo: 23.6.0
osInfo: macOS 15.7.1
cpuInfo: (16) arm64 Apple M3 Max
chromeInfo: 142.0.7444.162
edgeInfo: Not Found
firefoxInfo: undefined
safariInfo: 26.0.1
If you need more detailed info, just run this: npx codeceptjs info
***************************************
CodeceptJS v3.6.7 #StandWithUkraine
Using test root "/Users/xx/ccjs"
Helpers: Playwright, FileSystem
Plugins: screenshotOnFail, tryTo, retryFailedStep, retryTo, eachElement
Config hangs --
[1] Starting recording promises
› [Suite Config] Playwright {"restart":"session"}
Timeouts:
› [Session] Starting singleton browser session
do something 1
› [Dir] /Users/xx/ccjs
I am on page "https://codecept.io/quickstart/"
✔ OK in 1827ms
› [Session] cleaning cookies and localStorage
do something 2
› [Dir] /Users/xx/ccjs
I wait for text "Quickstart"
✔ OK in 5ms
› [Session] cleaning cookies and localStorage
do something 3
› [Dir] /Users/xx/ccjs
I see "If you prefer not to use Playwright"
✔ OK in 15ms
› [Session] cleaning cookies and localStorage
› [Suite Config] Reverted for Playwright
OK | 3 passed // 3s <- hangs here
Expected output:
~hxllv~ ~/ccjs npx codeceptjs run featureConfigHang.js --verbose
***************************************
nodeInfo: 23.6.0
osInfo: macOS 15.7.1
cpuInfo: (16) arm64 Apple M3 Max
chromeInfo: 142.0.7444.162
edgeInfo: Not Found
firefoxInfo: undefined
safariInfo: 26.0.1
If you need more detailed info, just run this: npx codeceptjs info
***************************************
CodeceptJS v3.6.7 #StandWithUkraine
Using test root "/Users/xx/ccjs"
Helpers: Playwright, FileSystem
Plugins: screenshotOnFail, tryTo, retryFailedStep, retryTo, eachElement
Config hangs --
[1] Starting recording promises
Timeouts:
› [Session] Starting singleton browser session
do something 1
› [Dir] /Users/xx/ccjs
I am on page "https://codecept.io/quickstart/"
✔ OK in 1648ms
› [Session] cleaning cookies and localStorage
do something 2
› [Dir] /Users/xx/ccjs
I wait for text "Quickstart"
✔ OK in 8ms
› [Session] cleaning cookies and localStorage
do something 3
› [Dir] /Users/xx/ccjs
I see "If you prefer not to use Playwright"
✔ OK in 3ms
› [Session] cleaning cookies and localStorage
OK | 3 passed // 2s
~hxllv~ ~/ccjs <- back in control of terminal
- 主要言語
- JavaScript
- スター
- 4.2k
- フォーク
- 756
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 16
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
codeceptjs/CodeceptJS のほかの issue
-
stale
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
codeceptjs/CodeceptJS#5420 · コメント 1 件 ·
-
stale
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
codeceptjs/CodeceptJS#5358 · コメント 1 件 ·
-
stale
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
codeceptjs/CodeceptJS#4958 · コメント 10 件 · リアクション 2 件 ·
-
stale
難易度 1/5 1時間未満 初心者へのやさしさ 72/100
codeceptjs/CodeceptJS#4778 · コメント 3 件 ·
-
stale
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
codeceptjs/CodeceptJS#5618 · コメント 1 件 ·
codeceptjs/CodeceptJS の issue をすべて見る
似ている issue
-
ai-observability bug team/ai-observability
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
AllTheMods/ATM-10-L#19 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
SignalK/n2k-signalk#345 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
JuliaPluto/PlutoPlotly.jl#72 ·