Skip to content

Fix web server release test due to mismatch in Request ID #3665

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

Open
acuarica opened this issue Apr 10, 2025 · 0 comments
Open

Fix web server release test due to mismatch in Request ID #3665

acuarica opened this issue Apr 10, 2025 · 0 comments

Comments

@acuarica
Copy link
Contributor

acuarica commented Apr 10, 2025

The following release test for Web Server consistently fails (you can run it using acceptancetest:release_ws)

$ npm run acceptancetest:release_ws
[...]
 1) RPC Server Acceptance Tests
       Acceptance tests
         @web-socket-batch-request Batch Requests
           given WS_BATCH_REQUESTS_ENABLED=true are set
             @release Should submit batch requests to WS server using Standard Web Socket and retrieve batch responses:

      AssertionError: expected [ { result: '0x129', …(2) }, …(4) ] to deeply equal [ { result: '0x129', …(2) }, …(4) ]
      + expected - actual

         }
         {
           "error": {
             "code": -32602
      -      "message": "[Request ID: d79be947-5fcb-44e8-8ee9-5c04847cb26c] Invalid parameter 0: Expected 0x prefixed string representing the address (20 bytes), value: 0xhedera"
      +      "message": "[Request ID: 7c3b0dc6-f7b7-4219-9f64-672488ec10e8] Invalid parameter 0: Expected 0x prefixed string representing the address (20 bytes), value: 0xhedera"
           }
           "id": 1
           "jsonrpc": "2.0"
         }
      
      at Suite.<anonymous> (packages/ws-server/tests/acceptance/batchRequest.spec.ts:80:38)
      at Generator.next (<anonymous>)
      at fulfilled (packages/ws-server/tests/acceptance/batchRequest.spec.ts:6:58)
[...]

The problem seems to be just the comparison. Note that the messages only differ in the Request ID (which makes sense) given how the test work

it(`@release Should submit batch requests to WS server using Standard Web Socket and retrieve batch responses`, async () => {
// call batch request
const batchResponses = await WsTestHelper.sendRequestToStandardWebSocket(METHOD_NAME, batchRequests);
// individually process each request
const promises: any = [];
batchRequests.forEach((request: any) => {
promises.push(WsTestHelper.sendRequestToStandardWebSocket(request.method, request.params));
});
const individualResponses = await Promise.all(promises);
expect(batchResponses).to.deep.eq(individualResponses);
});

A possible solution would just to mask the Request ID when a given response is an error.

Note

I believe this test is not being run on CI, that's why we didn't detect it earlier.

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

1 participant