0

I have a CI setup in Github which runs all the tests I currently have (200 approx) which are e2e tests using jest and superagent, following NestJS's standard testing pattern, also meaning that I have one or more test suites (files) for each module

Everything was pink and beautiful until recently I had to implement some queue using BullMQ (also integrated in the framework). At this point my PR keeps failing the checks, even skipping test suites that actually tests the endpoints using the queue, blowing up memory, and timing out another theoretically unrelated suites. This is the final error trace:

<--- Last few GCs --->

[2400:0x57d01a0]   287364 ms: Mark-sweep 1846.7 (2086.3) -> 1830.1 (2083.3) MB, 
1710.5 / 9.9 ms  (average mu = 0.173, current mu = 0.177) allocation failure scavenge 
might not succeed
[2400:0x57d01a0]   289587 ms: Mark-sweep 1846.6 (2083.3) -> 1833.2 (2080.8) MB, 
1649.9 / 0.1 ms  (average mu = 0.216, current mu = 0.258) task scavenge might not 
succeed


<--- JS stacktrace --->

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript 
heap out of memory
 1: 0xb00d90 node::Abort() [/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
 2: 0xa1823b node::FatalError(char const*, char const*) 
[/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
 3: 0xcedbce v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) 
[/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
 4: 0xcedf47 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char 
const*, bool) [/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
 5: 0xea6105  [/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
 6: 0xea6be6  [/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
 7: 0xeb4b1e  [/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
 8: 0xeb5560 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, 
v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) 
[/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
 9: 0xeb84de v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, 
v8::internal::AllocationType, v8::internal::AllocationOrigin, 
v8::internal::AllocationAlignment) [/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
10: 0xe7990a v8::internal::Factory::NewFillerObject(int, bool, 
v8::internal::AllocationType, v8::internal::AllocationOrigin) 
[/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
11: 0x11f2f06 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, 
v8::internal::Isolate*) [/opt/hostedtoolcache/node/16.13.1/x64/bin/node]. 
12: 0x15e7819  [/opt/hostedtoolcache/node/16.13.1/x64/bin/node]
Aborted (core dumped)

Custom code implementation increase is very little besides using as I said BullMQ modules/decorators already integrated in NestJS, and the tests are passing nice locally

I belive if the issue is related to the queue implementation and that now I added Redis setup to the CI, if I skip the tests building the modules using this implementation, everything should be fine, but this keeps happening

Tried increasing global timeout setting, but nothing changed so far

I have been wondering around trying to find the underlying cause for some days now but got nothing

Feeling completely lost at this point, has anyone any idea of what could be happening here or any clue on how to hunt the underlying cause of this?

Thanks in advance

SeekanDestroy
  • 511
  • 1
  • 5
  • 12

0 Answers0