clean up tests. remove placeholder assert-true tests, fix replay
protection and NAT test logic, fix MWP connection test peer ID registration, use atomic port counter for test parallelism
This commit is contained in:
@@ -17,13 +17,11 @@ const PieceHash = files.hash.PieceHash;
|
||||
const network = @import("network");
|
||||
const PeerId = network.peer.PeerId;
|
||||
|
||||
// Port allocation for tests
|
||||
var next_port: u16 = 19401;
|
||||
// Port allocation for tests (atomic for parallel test safety)
|
||||
var next_port = std.atomic.Value(u16).init(19401);
|
||||
|
||||
fn getNextPort() u16 {
|
||||
const port = next_port;
|
||||
next_port += 1;
|
||||
return port;
|
||||
return next_port.fetchAdd(1, .acq_rel);
|
||||
}
|
||||
|
||||
fn createTestConfig(port: u16) P2PConfig {
|
||||
|
||||
Reference in New Issue
Block a user