()
| 99 | }); |
| 100 | |
| 101 | async function createObject() { |
| 102 | const obj = await fn(); |
| 103 | f.register(obj); |
| 104 | if (count++ < maxCount && !anyFinalized) { |
| 105 | setImmediate(createObject, 1); |
| 106 | } |
| 107 | // This can force a more thorough GC, but can slow the test down |
| 108 | // significantly in a big heap. Use it with care. |
| 109 | if (count % generateSnapshotAt === 0) { |
| 110 | // XXX(joyeecheung): This itself can consume a bit of JS heap memory, |
| 111 | // but the other alternative writeHeapSnapshot can run into disk space |
| 112 | // not enough problems in the CI & be slower depending on file system. |
| 113 | // Just do this for now as long as it works and only invent some |
| 114 | // internal voodoo when we absolutely have no other choice. |
| 115 | require('v8').getHeapSnapshot().pause().read(); |
| 116 | console.log(`Generated heap snapshot at ${count}`); |
| 117 | } |
| 118 | if (count % logEvery === 0) { |
| 119 | console.log(`Created ${count} objects`); |
| 120 | } |
| 121 | if (anyFinalized) { |
| 122 | console.log(`Found finalized object at ${count}, stop testing`); |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | createObject(); |
| 127 | } |
no test coverage detected
searching dependent graphs…