@@ -133,6 +133,10 @@ TEST_CASE("TCPPeer read malformed messages", "[overlay][tcppeer]")
133133 // Slow down the main thread to delay drops
134134 cfg.ARTIFICIALLY_SLEEP_MAIN_THREAD_FOR_TESTING =
135135 std::chrono::milliseconds (300 );
136+ // Don't run SCP: this test counts messages received by each
137+ // peer, and SCP traffic between the nodes would pollute the
138+ // counts nondeterministically
139+ cfg.FORCE_SCP = false ;
136140 return cfg;
137141 });
138142
@@ -157,9 +161,9 @@ TEST_CASE("TCPPeer read malformed messages", "[overlay][tcppeer]")
157161 n0->getOverlayManager ().getOverlayMetrics ().mRecvErrorTimer ;
158162 auto p0recvErrorCount = p0recvError.count ();
159163
160- auto const & msgRead =
161- n1->getOverlayManager ().getOverlayMetrics ().mMessageRead ;
162- auto msgReadPrev = msgRead .count ();
164+ auto const & recvTx =
165+ n1->getOverlayManager ().getOverlayMetrics ().mRecvTransactionTimer ;
166+ auto recvTxPrev = recvTx .count ();
163167
164168 auto msg = makeStellarMessage (1 );
165169
@@ -173,9 +177,7 @@ TEST_CASE("TCPPeer read malformed messages", "[overlay][tcppeer]")
173177 {
174178 // p0 received ERROR from p1
175179 REQUIRE (p0recvErrorCount + 1 == p0recvError.count ());
176- // p1 did not read the next message in the socket after receiving a
177- // malformed message
178- REQUIRE (msgReadPrev + 1 == msgRead.count ());
180+ REQUIRE (recvTx.count () == recvTxPrev);
179181 }
180182 };
181183
0 commit comments