Session trace not cleaned up causing "tracing.stop" error in subsequent tests with Playwright
Chưa có ai nhận issue này.
Đá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
- 48/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Ít trao đổi
- Công nghệ
- javascript, node.js, playwright
- Lĩnh vực
- testing
Hướng nghiên cứu
Bắt đầu với helper session() và vòng đời trace của Playwright, sử dụng kịch bản session_test.js đã được tái hiện cùng cấu hình bật trace và keepTraceForPassedTests. Chạy lần lượt cả hai kịch bản và theo dõi quá trình dọn dẹp sau khi session context đóng. Hoàn tất khi quá trình tái hiện kết thúc mà không có lỗi tracing.stop và việc xử lý trace vẫn đúng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What are you trying to achieve?
I'm trying to run multiple test scenarios where the first scenario uses session() with Playwright helper and trace enabled. Both tests should pass without errors.
What do you get instead?
After the second test completes successfully, CodeceptJS throws an error:
Error: tracing.stop: Target page, context or browser has been closed
The session created in the first test is not properly cleaned up, and when the second test finishes, CodeceptJS attempts to save the trace for the old session that no longer exists.
Provide console output if related. Use
--verbosemode for more details.
Session Bug Reproduction --
D:\projects\codeceptjs-bug\session_test.js
First test with session
Scenario()
I am on page "/"
user1: I am on page "/"
user1: I see "Example Domain"
I see "Example Domain"
✓ OK in 4197ms
Second test - should fail with trace error
Scenario()
I am on page "/"
I see "Example Domain"
✓ OK in 630ms
Error: tracing.stop: Target page, context or browser has been closed
OK | 2 passed // 6s
Provide test source code if related
Feature('Session Bug Reproduction');
Scenario('First test with session', ({ I }) => {
I.amOnPage('/');
session('user1', () => {
I.amOnPage('/');
I.see('Example Domain');
});
I.see('Example Domain');
});
Scenario('Second test - should fail with trace error', ({ I }) => {
I.amOnPage('/');
I.see('Example Domain');
});
Details
- CodeceptJS version: 3.7.6
- NodeJS Version: v20+ (any recent version)
- Operating System: Windows / Linux / macOS (reproduced on all)
- Playwright version: 1.40.0
- Configuration file:
exports.config = {
tests: './*_test.js',
output: './output',
helpers: {
Playwright: {
url: 'https://example.com',
show: false,
browser: 'chromium',
trace: true,
keepTraceForPassedTests: true
}
},
bootstrap: null,
mocha: {},
name: 'codeceptjs-session-bug'
}
Additional context
The issue appears when:
- Multiple scenarios are run in sequence
- Trace is enabled (especially with
keepTraceForPassedTests: true) - One or more scenarios use
session()helper
The session context is closed after the first scenario ends, but CodeceptJS still tries to stop tracing for it when the next scenario completes.
Minimal reproduction repository available if needed.
- Ngôn ngữ chính
- JavaScript
- Star
- 4.2k
- Fork
- 756
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 16
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của codeceptjs/CodeceptJS
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#5420 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
codeceptjs/CodeceptJS#5358 · 1 bình luận ·
-
stale
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
codeceptjs/CodeceptJS#4958 · 10 bình luận · 2 reaction ·
-
stale
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
codeceptjs/CodeceptJS#4778 · 3 bình luận ·
-
stale
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
codeceptjs/CodeceptJS#5618 · 1 bình luận ·
Tất cả issue của codeceptjs/CodeceptJS
Issue tương tự
-
Edit: CW+ Đang mởchannels:edit check:passed
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
스택 PR 머지 시 하위 PR base 재지정 단계 부재 Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
idean3885/claude-ops-agent#521 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
avniproject/avni-client#2135 ·
-
automated broken-link
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
-
agent/security hive/hosted-available-lke648397-260827-5n31 security
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100