hgcommands: setup fail points

Summary: Setup fail points so `FAILPOINTS` can work.

Reviewed By: andll

Differential Revision: D29888940

fbshipit-source-id: 4e6f98ed0a1c1410d6992f92ff810b5ef64ba76e
This commit is contained in:
Jun Wu 2021-07-26 15:21:54 -07:00 committed by Facebook GitHub Bot
parent 8cb3d3dd75
commit 08c596b72e
2 changed files with 5 additions and 0 deletions

View File

@ -20,6 +20,7 @@ eagerepo = { path = "../eagerepo" }
edenapi = { path = "../edenapi" }
edenfs_client = { path = "../edenfs-client" }
encoding = { path = "../encoding" }
fail = { version = "0.4", features = ["failpoints"] }
flate2 = { version = "1.0", features = ["rust_backend", "tokio"], default-features = false }
fsyncglob = { path = "../fsyncglob" }
hg-http = { path = "../hg-http" }

View File

@ -14,6 +14,7 @@ use clidispatch::io::IO;
use clidispatch::{dispatch, errors};
use clientinfo::ClientInfo;
use configparser::config::ConfigSet;
use fail::FailScenario;
use hg_http::HgHttpConfig;
use once_cell::sync::Lazy;
use parking_lot::Mutex;
@ -69,6 +70,7 @@ pub fn run_command(args: Vec<String>, io: &IO) -> i32 {
Ok(res) => res,
};
let scenario = FailScenario::setup();
setup_eager_repo();
// This is intended to be "process start". "exec/hgmain" seems to be
@ -169,6 +171,8 @@ pub fn run_command(args: Vec<String>, io: &IO) -> i32 {
// so we need to flush now.
blackbox::sync();
scenario.teardown();
exit_code
}