network
network copied to clipboard
test(trackerless-network): Memory leak test
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])