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

Commit 1a6cb493 authored by Mike Yu's avatar Mike Yu
Browse files

Fix flaky ResolverTest.ConnectTlsServerTimeout due to flag reset

Same as aosp/1552338. To reduce the flaky rate, set the flag every
time before the test network is created.

Bug: 178655866
test: ResolverTest.ConnectTlsServerTimeout passed
Change-Id: Ic9d26be9892235fba77cb2e6d264419a0ff963f1
parent 79215996
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -4326,9 +4326,6 @@ TEST_F(ResolverTest, ConnectTlsServerTimeout) {
            {hostname2, ns_type::ns_t_a, "1.2.3.5"},
    };

    // The resolver will adjust the timeout value to 1000ms since the value is too small.
    ScopedSystemProperties scopedSystemProperties(kDotConnectTimeoutMsFlag, "100");

    static const struct TestConfig {
        bool asyncHandshake;
        int maxRetries;
@@ -4357,6 +4354,8 @@ TEST_F(ResolverTest, ConnectTlsServerTimeout) {
        test::DnsTlsFrontend tls(addr, "853", addr, "53");
        ASSERT_TRUE(tls.startServer());

        // The resolver will adjust the timeout value to 1000ms since the value is too small.
        ScopedSystemProperties scopedSystemProperties(kDotConnectTimeoutMsFlag, "100");
        ScopedSystemProperties scopedSystemProperties1(kDotAsyncHandshakeFlag,
                                                       config.asyncHandshake ? "1" : "0");
        ScopedSystemProperties scopedSystemProperties2(kDotMaxretriesFlag,