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

test: Update Jest and add custom reporter to stream-tests #3235

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ukstv
Copy link
Contributor

@ukstv ukstv commented Jun 5, 2024

This is to help diagnose our sudden OOM failures while testing on CI. There is no clue at what point, at what test file or test case, the OOM happens. The PR adds a custom Jest reporter that prints (via console.log) a message to console when:

  • a test file starts,
  • a test file finishes,
  • a test case (i.e. test or it call) starts,
  • a test case finishes.

A message includes process.memoryUsage().heapUsed so that we could also see how the memory usage progresses.

I expect this makes it easier to diagnose a future OOM occurrence. After we fix it, the custom Jest reporter should be removed.

Now the changes:

  1. Update Jest because our current version does not call reporter hooks onTestCaseStart and onTestCaseResult.
  2. Add a custom Jest reporter to stream-tests package: the one that OOMs.
  3. Change order of closing - first close anchor request loop, then anchor request store. There is a clear indication the current close order is wrong. I am not sure though if it is a reason for OOM.

@ukstv ukstv requested review from dbcfd, stbrody and JulissaDantes June 5, 2024 13:37
@ukstv
Copy link
Contributor Author

ukstv commented Jun 5, 2024

Amazing! OOM right away!

@ukstv ukstv marked this pull request as draft June 5, 2024 14:40
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.

1 participant