dapr / js-sdk

Dapr SDK for Javascript
Apache License 2.0
194 stars 82 forks source link

fix e2e test common/server/server.test.ts #555

Closed MregXN closed 9 months ago

MregXN commented 9 months ago

Description

It fails due to the following log. For more log details refer to this link.

...
  ● common/server › pubsub › grpc/should mark messages as processed successfully (SUCCESS) by-default, and the same message should not be received anymore

    expect(received).toBe(expected) // Object.is equality

    Expected: 1
    Received: 0

      163 |         // Delay a bit for event to arrive
      164 |         await new Promise((resolve, _reject) => setTimeout(resolve, 1000));
    > 165 |         expect(mockSubscribeStatusHandler.mock.calls.length).toBe(1);
          |                                                              ^
      166 |         expect(mockSubscribeStatusHandler.mock.calls[0][1]).toEqual("SUCCESS");
      167 |         expect(mockSubscribeDeadletterHandler.mock.calls.length).toBe(0);
      168 |       },

      at test/e2e/common/server.test.ts:165:62
      at fulfilled (test/e2e/common/server.test.ts:17:58)
...

The delay is not long enough to wait for the event to arrive. Adding more delay could be helpful.

Issue reference

Please refer to the the point 4 of issue #7128 in dapr/dapr.

codecov[bot] commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (d33c5a4) 100.00% compared to head (76cd8b5) 100.00%. Report is 5 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #555 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 1 1 Lines 6 6 Branches 1 1 ========================================= Hits 6 6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

shubham1172 commented 9 months ago

Closing this PR to fix flakiness in tests for now, root cause still remains to be inspected and will be tracked by #560