Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c19eac9f authored by Mike Yu's avatar Mike Yu Committed by Automerger Merge Worker
Browse files

Merge "Make PrivateDnsDohTest.SessionResumption more robust against flag...

Merge "Make PrivateDnsDohTest.SessionResumption more robust against flag reset" am: b537dfdd am: 693250e5 am: 3629e45e

Original change: https://android-review.googlesource.com/c/platform/packages/modules/DnsResolver/+/2010577

Change-Id: Ide59ca794467319139f461a2c3ced327ce8f4a38
parents fd3e36e4 3629e45e
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -974,7 +974,14 @@ TEST_F(PrivateDnsDohTest, ConnectionIdleTimer) {
TEST_F(PrivateDnsDohTest, SessionResumption) {
    const int initial_max_idle_timeout_ms = 1000;
    for (const auto& flag : {"0", "1"}) {
        SCOPED_TRACE(fmt::format("flag: {}", flag));
        auto sp = make_unique<ScopedSystemProperties>(kDohSessionResumptionFlag, flag);

        // Each loop takes around 3 seconds, if the system property "doh" is reset in the middle
        // of the first loop, this test will fail when running the second loop because DnsResolver
        // updates its "doh" flag when resetNetwork() is called. Therefore, add another
        // ScopedSystemProperties for "doh" to make the test more robust.
        auto sp2 = make_unique<ScopedSystemProperties>(kDohFlag, "1");
        resetNetwork();

        ASSERT_TRUE(doh.stopServer());