Skip to content

JSON format issue, especially with larger reports, such as 500MB in size #2406

@pavankumardmg

Description

@pavankumardmg

👓 What did you see?

When I use JSON format to generate results, I encounter the following error.

error logs:

/app/node_modules/@cucumber/cucumber/src/formatter/json_formatter.ts:185
this.log(JSON.stringify(features, null, 2))
^
RangeError: Invalid string length
at JSON.stringify ()
at JsonFormatter.onTestRunFinished (/app/node_modules/@cucumber/cucumber/src/formatter/json_formatter.ts:185:19)
at EventEmitter. (/app/node_modules/@cucumber/cucumber/src/formatter/json_formatter.ts:92:14)
at EventEmitter.emit (node:events:532:35)
at EventEmitter.emit (node:domain:488:12)
at Coordinator.onWorkerProcessClose (/app/node_modules/@cucumber/cucumber/src/runtime/parallel/coordinator.ts:185:29)
at ChildProcess. (/app/node_modules/@cucumber/cucumber/src/runtime/parallel/coordinator.ts:146:12)
at ChildProcess.emit (node:events:520:28)
at ChildProcess.emit (node:domain:488:12)
at maybeClose (node:internal/child_process:1105:16)

✅ What did you expect to see?

Expected to see a JSON report without any formatting issues

📦 Which tool/library version are you using?

node version 18.17.0 or latest
cucumber ts 10.6.0

🔬 How could we reproduce it?

Steps to Reproduce:

  1. In the runner file, use JSON format and add the JSON path to generate the reports.
  2. Include additional screenshots in the test scripts to increase the report size to over 500MB, then observe the json formatter issue after the test is completed.
  3. Observe the following error and the same issue has been logged and closed. reference [https://github.com/[json-formatter] Cannot create a string longer than 0x1fffffe8 characters common#1763]

📚 Any additional context?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions