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

Serialization issue on big job definition #92

Closed
ArnaudBuchholz opened this issue Jun 17, 2024 · 4 comments
Closed

Serialization issue on big job definition #92

ArnaudBuchholz opened this issue Jun 17, 2024 · 4 comments

Comments

@ArnaudBuchholz
Copy link
Owner

[ui5:test:executor] [████████░░]  87% http://localhost:8080/test/opaTests.qunit.html
[ui5:test:executor] [█████░░░░░]  50% ⠙ Executing test pages
[ui5:test:executor] 10:55 << http://localhost:8080/test/opaTests.qunit.html    (10:41) [tz33vWePi8M]
[ui5:test:executor]
[ui5:test:executor] 10:55 │ Generating reports
[ui5:test:executor] ──────┴───────────────────
[ui5:test:executor] ┌──────────────────────────────────────────────────────────────────────────────┐
[ui5:test:executor] │ UNEXPECTED ERROR                                                             │
[ui5:test:executor] ├──────────────────────────────────────────────────────────────────────────────┤
[ui5:test:executor] │ RangeError: Invalid string length                                            │
[ui5:test:executor] │     at JSON.stringify (<anonymous>)                                          │
[ui5:test:executor] │     at serialize (C:\SAPDevelop\git\record-service-ui\ui-recordService\node↵ │
[ui5:test:executor] │ _modules\ui5-test-runner\src\report.js:11:83)                                │
[ui5:test:executor] │     at save (C:\SAPDevelop\git\record-service-ui\ui-recordService\node_modu↵ │
[ui5:test:executor] │ les\ui5-test-runner\src\report.js:20:9)                                      │
[ui5:test:executor] │     at generate (C:\SAPDevelop\git\record-service-ui\ui-recordService\node_↵ │
[ui5:test:executor] │ modules\ui5-test-runner\src\report.js:40:11)                                 │
[ui5:test:executor] │     at process (C:\SAPDevelop\git\record-service-ui\ui-recordService\node_m↵ │
[ui5:test:executor] │ odules\ui5-test-runner\src\tests.js:127:9)                                   │
[ui5:test:executor] │     at async notifyAndExecuteTests (C:\SAPDevelop\git\record-service-ui\ui-↵ │
[ui5:test:executor] │ recordService\node_modules\ui5-test-runner\index.js:26:5)                    │
[ui5:test:executor] │     at async EventEmitter.<anonymous> (C:\SAPDevelop\git\record-service-ui\↵ │
[ui5:test:executor] │ ui-recordService\node_modules\ui5-test-runner\index.js:66:7)                 │
[ui5:test:executor] └──────────────────────────────────────────────────────────────────────────────┘
[ui5:test:executor] npm run ui5:test:executor exited with code 0

Qualification : the job's JSON is too big to be serialized with JSON.stringify

Alternatives :

  • json-stream-stringify seems to be capable of saving very big JSONs in a stream. That would solve the issue on save but to be able to generate the reports, it would need to be able to read it again…
  • reduce the size of the JSON structure. Usually, this is because the assertions in the OPA tests are based on complex objects (for instance : Opa5.assert.ok(ui5Control)) and the runner keeps track of everything…
@heimwege
Copy link

Can confirm that Opa5.assert.ok(ui5Control) was the root cause for this huge JSON

@ArnaudBuchholz
Copy link
Owner Author

I still believe the runner should filter out these unnecessary values from the job report.

@ArnaudBuchholz
Copy link
Owner Author

Actually, this is a problem with UI5 objects detection that does not work in OPA with iFrames (because the base class are not the same between the OPA window and the application window). Used a safer method based on UI5 object known members (getId, getMetadata)

@ArnaudBuchholz
Copy link
Owner Author

Closing the incident as the initial problem is solved. Being able to generate a bigger JSON could be interesting but would cause other problems (such as the report generator that must be able to load the serialized the JSON).

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

No branches or pull requests

2 participants