andywer / leakage

🐛 Memory leak testing for node.
1.58k stars 52 forks source link

Can not 'passing'? #31

Closed chiaweilee closed 5 years ago

chiaweilee commented 6 years ago
const { iterate } = require('leakage')

describe('leakage', () => {
  it('does not leak when doing something', () => {
    iterate(() => {
      console.log('-')
    })
  })
})
 1) does not leak when doing something

  0 passing (3s)
  1 failing

  1) leakage
       does not leak when doing something:
     MemoryLeakError: Heap grew on 6 subsequent garbage collections (180 of 180 iterations) by 25.6 kB.

  Iterations between GCs: 30

  Final GC details:
  [    2.4 kB] [+  60x] [-   0x] Array
  [   1.68 kB] [+  30x] [-   0x] TickObject
  [    -464 B] [+  63x] [-  63x] Native

      at testConstantHeapSize (node_modules/_leakage@0.4.0@leakage/lib/testConstantHeapSize.js:24:12)
      at iterate (node_modules/_leakage@0.4.0@leakage/lib/index.js:64:21)
      at Context.it (test/leakage.spec.js:5:5)
andywer commented 6 years ago

Hey @chiaweilee! Thanks for the heads-up.

Could you please add some information about the setup in which you encountered that issue?

Thank you :)

chiaweilee commented 6 years ago

Thanks.