network icon indicating copy to clipboard operation
network copied to clipboard

test(trackerless-network): Memory leak test

Open teogeb opened this issue 2 years ago • 0 comments

Add memory leak test (TODO use DhtNode instead of NetworkStack)

Also a draft fix for a memory leak problem: do this fix in a separate PR. Note that the fix makes some other tests to fail (see CI runs in this PR), so we need to fine-tune the fix somehow.

TODO

If the test can't connect to entryPoint, maybe need to add websocketServerEnableTls: false

Use DhtNode instead of NetworkStack:

let entryPoint: DhtNode | undefined = new DhtNode({
    peerId: binaryToHex(epPeerDescriptor.kademliaId),
    websocketHost: epPeerDescriptor.websocket!.host,
    websocketPortRange: {
        min: epPeerDescriptor.websocket!.port,
        max: epPeerDescriptor.websocket!.port
    },
    entryPoints: [epPeerDescriptor]
})
await entryPoint.start()
await entryPoint.joinDht([epPeerDescriptor])

and remove node.setStreamPartEntryPoints(STREAM_PART_ID, [epPeerDescriptor])

teogeb avatar Nov 10 '23 13:11 teogeb