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

Commit 8f942fd4 authored by Akilesh Kailash's avatar Akilesh Kailash
Browse files

libsnapshot: Skip tests if update is in progress



Bug: 380992658
Test: vts_libsnapshot_test when update is in progress
Change-Id: Ib58ddcb9789b8502883a6b5322cae7dd7defdfbf
Signed-off-by: default avatarAkilesh Kailash <akailash@google.com>
parent 0c563315
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -3071,6 +3071,18 @@ int main(int argc, char** argv) {
    ::testing::AddGlobalTestEnvironment(new ::android::snapshot::SnapshotTestEnvironment());
    ::testing::AddGlobalTestEnvironment(new ::android::snapshot::SnapshotTestEnvironment());
    gflags::ParseCommandLineFlags(&argc, &argv, false);
    gflags::ParseCommandLineFlags(&argc, &argv, false);


    // During incremental flashing, snapshot updates are in progress.
    //
    // When snapshot update is in-progress, snapuserd daemon
    // will be up and running. These tests will start and stop the daemon
    // thereby interfering with the update and snapshot-merge progress.
    // Hence, wait until the update is complete.
    auto sm = android::snapshot::SnapshotManager::New();
    while (sm->IsUserspaceSnapshotUpdateInProgress()) {
        LOG(INFO) << "Snapshot update is in progress. Waiting...";
        std::this_thread::sleep_for(std::chrono::milliseconds(1000));
    }

    bool vab_legacy = false;
    bool vab_legacy = false;
    if (FLAGS_force_mode == "vab-legacy") {
    if (FLAGS_force_mode == "vab-legacy") {
        vab_legacy = true;
        vab_legacy = true;