ceramicnetwork / js-ceramic

Typescript implementation of the Ceramic protocol
http://ceramic.network
Other
414 stars 127 forks source link

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

Open ukstv opened 3 months ago

ukstv commented 3 months ago

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 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 commented 3 months ago

Amazing! OOM right away!