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:
2026-02-10 20:13:54 -03:00
parent a44af22739
commit b7d013a272
12 changed files with 19 additions and 169 deletions

View File

@@ -152,9 +152,6 @@ test "health check handles allocation failures gracefully" {
// Health checks should complete without crashing even if allocations fail internally
// This is difficult to test directly, but we can verify the function doesn't crash
try p2p.performHealthChecks();
// If we get here without crashing, the test passes
try testing.expect(true);
}
// Test discovery manager initialization failure is logged
@@ -174,9 +171,6 @@ test "discovery manager init failure logs warning" {
// Start should succeed even if discovery manager fails to init
try p2p.start();
defer p2p.stop() catch {};
// Test passes if we get here - discovery failure didn't prevent startup
try testing.expect(true);
}
// Test that route cleanup handles allocation failures
@@ -204,9 +198,6 @@ test "route cleanup handles allocation failures" {
// Cleanup should handle any allocation failures gracefully
router.cleanupExpiredRoutes(100); // Max age of 100 seconds
// If we get here without crashing, the test passes
try testing.expect(true);
}
// Test that getAllRoutes handles allocation failures
@@ -226,9 +217,6 @@ test "getAllRoutes handles allocation failures" {
// Get all routes - should handle allocation failures gracefully
var routes = router.getAllRoutes();
defer routes.deinit(allocator);
// Should succeed even if some routes couldn't be added to the list
try testing.expect(true);
}
// Integration test: verify no silent failures in critical path
@@ -259,9 +247,6 @@ test "integration: no silent failures in message routing" {
// Verify errors were logged (counters increased)
const final_errors = p2p.stats.errors_total.load(.monotonic);
try testing.expect(final_errors >= initial_errors);
// No silent failures - test passes
try testing.expect(true);
}
// Test that error statistics are properly tracked