allure-framework / allure-framework/allure-js
[allure-cypress] cy.task('allureReportTest') causing some test flakiness
- Dominant language
- TypeScript
- Stars
- 281
- Forks
- 137
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 13
Description
**Describe the bug**
**To Reproduce**
Tough to reproduce, seems a race condition. Stack trace:
```
From Node.js Internals:
TypeError: Cannot read properties of undefined (reading 'stage')
at allureReportTest (/builds/redadcted/npm/src/main/npm/node_modules/allure-cypress/dist/reporter.js:3358:38)
at invoke (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:248:16)
at (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:59:14)
at tryCatcher (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/bluebird/js/release/util.js:16:23)
at Function.Promise.attempt.Promise.try (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/bluebird/js/release/method.js:39:29)
at Object.wrapChildPromise (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:58:23)
at RunPlugins.taskExecute (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:254:10)
at RunPlugins.execute (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:166:21)
at EventEmitter. (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/child/run_plugins.js:56:12)
at EventEmitter.emit (node:events:517:28)
at EventEmitter.emit (node:domain:489:12)
at process. (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/@packages/server/lib/plugins/util.js:33:22)
at process.emit (node:events:517:28)
at process.emit (node:domain:489:12)
at process.emit.sharedData.processEmitHook.installedValue [as emit] (/builds/redadcted/cache/Cypress/13.5.0/Cypress/resources/app/node_modules/@cspotcode/source-map-support/source-map-support.js:745:40)
at emit (node:internal/child_process:944:14)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
```
**Expected behavior**
No tests should fail BECAUSE of the plugin. I would rather lose data than cause flaky tests.
**Additional context**
version 2.14
Contributor guide
Research direction
Start with the cy.task('allureReportTest') entry point and the stack-trace location in allure-cypress/dist/reporter.js around line 3358. Reproduce under Cypress 13.5.0 with version 2.14 and inspect when the value used for stage is undefined. Done means plugin-triggered test failures no longer occur, even if report data is lost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cypress, typescript
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100