1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-01-31 11:23:40 +00:00

test: fix watchdir CI flake (#3839)

This commit is contained in:
Charles Kerr 2022-09-22 15:42:06 -05:00 committed by GitHub
parent 228efa16e3
commit 76fc42b659
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -234,17 +234,17 @@ TEST_P(WatchDirTest, retry)
}; };
auto watchdir = createWatchDir(path, callback); auto watchdir = createWatchDir(path, callback);
auto constexpr FastRetryWaitTime = 20ms; auto constexpr FastRetryWaitTime = 20ms;
auto constexpr ThreeRetries = FastRetryWaitTime * 4; auto constexpr SlowRetryWaitTime = 200ms;
auto* const base_watchdir = dynamic_cast<impl::BaseWatchdir*>(watchdir.get()); auto* const base_watchdir = dynamic_cast<impl::BaseWatchdir*>(watchdir.get());
ASSERT_TRUE(base_watchdir != nullptr); ASSERT_TRUE(base_watchdir != nullptr);
base_watchdir->setRetryDuration(FastRetryWaitTime); base_watchdir->setRetryDuration(FastRetryWaitTime);
processEvents(ThreeRetries); processEvents(SlowRetryWaitTime);
EXPECT_EQ(0U, std::size(names)); EXPECT_EQ(0U, std::size(names));
auto const test_file = "test.txt"sv; auto const test_file = "test.txt"sv;
createFile(path, test_file); createFile(path, test_file);
processEvents(ThreeRetries); processEvents(SlowRetryWaitTime);
EXPECT_LE(2U, std::size(names)); EXPECT_LE(2U, std::size(names));
for (auto const& name : names) for (auto const& name : names)
{ {