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

Commit 59581cc2 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "libsnapshot: Skip tests if update is in progress" into main

parents 6ddb8684 8f942fd4
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -3072,6 +3072,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;