Skip to content

Conversation

@vladopajic
Copy link
Contributor

@vladopajic vladopajic commented Jun 10, 2025

when running client, parsing ResultValue from ostdout lines can throw exception if line could not be parsed.

in order to help developers, new console.error was added to display line that caused error.

also, error will be swallowed, which will give more robustness in running client as it will tolerated non json lines in the output.


PR inspired by
#658 (comment)

=== Starting client nim-libp2p/v1.10/tcp
/home/runner/work/test-plans/test-plans/perf/runner/src/index.ts:211
        const result = JSON.parse(line) as ResultValue;
                            ^
SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at runClient (/home/runner/work/test-plans/test-plans/perf/runner/src/index.ts:211:29)
    at runBenchmarkAcrossVersions (/home/runner/work/test-plans/test-plans/perf/runner/src/index.ts:150:28)
    at main (/home/runner/work/test-plans/test-plans/perf/runner/src/index.ts:23:9)
    at Object.<anonymous> (/home/runner/work/test-plans/test-plans/perf/runner/src/index.ts:271:1)
    at Module._compile (node:internal/modules/cjs/loader:1529:14)
    at Module.m._compile (/home/runner/work/test-plans/test-plans/perf/runner/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
    at Object.require.extensions.<computed> [as .ts] (/home/runner/work/test-plans/test-plans/perf/runner/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1275:32)

@p-shahi p-shahi merged commit 7f13a38 into libp2p:master Jun 10, 2025
codemaestro64 pushed a commit to codemaestro64/test-plans that referenced this pull request Oct 28, 2025
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

Successfully merging this pull request may close these issues.

2 participants