Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[allure-cypress] cy.task('allureReportTest') causing some test flakiness #1064

Open
RobertBattaglia opened this issue Jul 16, 2024 · 2 comments

Comments

@RobertBattaglia
Copy link

RobertBattaglia commented Jul 16, 2024

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 <unknown> (/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.<anonymous> (/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.<anonymous> (/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

@baev
Copy link
Member

baev commented Jul 17, 2024

the problem should be already fixed in [email protected], could you please give it a try

@RobertBattaglia
Copy link
Author

For context, with Cypress v 13.4.0 node version 20.9.0
Trying to use the 3.0.0-beta any version I get:

Oops...we found an error preparing this test file:

  > cypress/support/e2e.ts

The error was:

SyntaxError: Unexpected token (1:3594) while parsing /e2e/node_modules/allure-cypress/dist/cjs/index.js while parsing file: /e2e/node_modules/allure-cypress/dist/cjs/index.js
    at DestroyableTransform.end [as _flush] (/e2e/node_modules/insert-module-globals/index.js:114:21)
    at DestroyableTransform.prefinish (/e2e/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:138:10)
    at DestroyableTransform.emit (node:events:514:28)
    at DestroyableTransform.emit (node:domain:488:12)
    at prefinish (/e2e/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:619:14)
    at finishMaybe (/e2e/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:627:5)
    at endWritable (/e2e/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:638:3)
    at DestroyableTransform.Writable.end (/e2e/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:594:22)
    at DestroyableTransform.onend (/e2e/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:577:10)
    at Object.onceWrapper (node:events:628:28)
    at DestroyableTransform.emit (node:events:526:35)
    at DestroyableTransform.emit (node:domain:488:12)
    at endReadableNT (/e2e/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:1010:12)
at processTicksAndRejections (node:internal/process/task_queues:82:21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants