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

Commit 6fd6fd2a authored by Mike Yu's avatar Mike Yu
Browse files

Test: Make the test TestEarlyDataFlag more robust against flag reset

The test takes around 4 seconds. It's possible that the device_config
flags are reset (which resets doh flag to 0 on Q/R/S) in the middle
of the test. Therefore, set doh flag to 1 right before resetNetwork()
to ensure the flag is 1 on the test network.

Bug: 248153420
Test: TestEarlyDataFlag pass
Change-Id: Ia839093410fcd0a737d1015527b60e65d419a52c
parent 9c411c36
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1108,6 +1108,11 @@ TEST_F(PrivateDnsDohTest, TestEarlyDataFlag) {
        SCOPED_TRACE(fmt::format("flag: {}", flag));
        ScopedSystemProperties sp1(kDohSessionResumptionFlag, flag);
        ScopedSystemProperties sp2(kDohEarlyDataFlag, flag);

        // As each loop takes around 2 seconds, it's possible the device_config flags are reset
        // in the middle of the test. Add another ScopedSystemProperties for "doh" to make the
        // test more robust.
        ScopedSystemProperties sp3(kDohFlag, "1");
        resetNetwork();

        ASSERT_TRUE(doh.stopServer());