Skip to content

Commit 5f95f09

Browse files
committed
Add a few delays in TestInfoConnected to reduce flakiness.
1 parent 3ea7a5f commit 5f95f09

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

database/integration_test/src/integration_test.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1189,16 +1189,22 @@ TEST_F(FirebaseDatabaseTest, TestInfoConnected) {
11891189
}
11901190
LogDebug("Disconnecting...");
11911191
database_->GoOffline();
1192+
// Pause a moment to give the SDK time to realize we are disconnected.
1193+
ProcessEvents(1000);
11921194
{
11931195
auto disconnected = info.GetValue();
11941196
WaitForCompletion(disconnected, "GetValue 3");
11951197
EXPECT_EQ(disconnected.result()->value(), false);
11961198
}
11971199
LogDebug("Reconnecting...");
11981200
database_->GoOnline();
1201+
// Pause a moment to give the SDK time to realize we are reconnected.
11991202
ProcessEvents(1000);
12001203
// Force getting a value so that we reconnect to the database.
12011204
WaitForCompletion(ref.GetValue(), "GetValue 4 [ignored]");
1205+
// Pause another moment to REALLY give the SDK time to realize we are
1206+
// reconnected.
1207+
ProcessEvents(1000);
12021208
{
12031209
auto reconnected = info.GetValue();
12041210
WaitForCompletion(reconnected, "GetValue 5");

0 commit comments

Comments
 (0)