From 185326b2fe467ac3cedd30da4dcf2ea76fa8d228 Mon Sep 17 00:00:00 2001
From: Nicolas Pope <nicolas.pope@utu.fi>
Date: Tue, 10 May 2022 17:51:58 +0100
Subject: [PATCH] Fix for net tests

---
 src/peer.cpp             | 1 -
 test/net_integration.cpp | 5 ++---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/peer.cpp b/src/peer.cpp
index 0151038..d122eff 100644
--- a/src/peer.cpp
+++ b/src/peer.cpp
@@ -538,7 +538,6 @@ bool Peer::waitConnection(int s) {
 	});
 
 	cv.wait_for(lk, seconds(s), [this]() { return status_ == NodeStatus::kConnected;});
-	if (status_ != NodeStatus::kConnected) LOG(ERROR) << "NOT CONNECTED: " << int(status_);
 	return status_ == NodeStatus::kConnected;
 }
 
diff --git a/test/net_integration.cpp b/test/net_integration.cpp
index 217ba28..c83f8cb 100644
--- a/test/net_integration.cpp
+++ b/test/net_integration.cpp
@@ -48,7 +48,7 @@ TEST_CASE("Listen and Connect", "[net]") {
 		
 		REQUIRE( p->waitConnection(5) );
 		
-		REQUIRE( self->numberOfNodes() == 1 );
+		REQUIRE( self->waitConnections() == 1 );
 		REQUIRE( ftl::getSelf()->numberOfNodes() == 1);
 	}
 
@@ -81,7 +81,6 @@ TEST_CASE("Listen and Connect", "[net]") {
 				// remote closes on first connection
 				disconnected_once = true;
 				p_listening->close(true);
-				LOG(INFO) << "disconnected";
 			} else {
 				// notify on second
 				cv.notify_one();
@@ -90,7 +89,7 @@ TEST_CASE("Listen and Connect", "[net]") {
 		});
 
 		REQUIRE(cv.wait_for(lk, std::chrono::seconds(5)) == std::cv_status::no_timeout);
-		REQUIRE(p_connecting->isConnected());
+		REQUIRE(p_connecting->waitConnection(5));
 	}
 
 	SECTION("automatic reconnect from originating connection") {
-- 
GitLab