Skip to content

Commit

Permalink
test: fixed race condition in postgres integration test (envoyproxy#3…
Browse files Browse the repository at this point in the history
…0354)

Commit Message:
fixed race condition in postgres integration test
Additional Description:
Typical race condition. Reply was received before calling clearData, which basically dropped received reply.
Risk Level: Low
Testing: Verified that previously failing test does not fail anymore.
Docs Changes: No
Release Notes: No
Platform Specific Features: No
Fixes envoyproxy#30330
Signed-off-by: Christoph Pakulski <[email protected]>
  • Loading branch information
cpakulski authored Oct 20, 2023
1 parent dc841d1 commit 775f3a6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -610,12 +610,12 @@ TEST_P(UpstreamAndDownstreamSSLIntegrationTest, ServerAgreesForSSL) {
// Reply to Envoy with 'S' and attach TLS socket to upstream.
upstream_data.add("S");
ASSERT_TRUE(fake_upstream_connection_->write(upstream_data.toString()));
fake_upstream_connection_->clearData();

config_factory_.recv_sync_.WaitForNotification();
enableTLSOnFakeUpstream();
config_factory_.proceed_sync_.Notify();

fake_upstream_connection_->clearData();
ASSERT_TRUE(fake_upstream_connection_->waitForData(data.length(), &rcvd));
// Make sure that upstream received initial postgres request, which
// triggered upstream SSL negotiation and TLS handshake.
Expand Down

0 comments on commit 775f3a6

Please sign in to comment.