diff --git a/tests/integration/util/standalone.rs b/tests/integration/util/standalone.rs index 43f599eb..eb0bfffc 100644 --- a/tests/integration/util/standalone.rs +++ b/tests/integration/util/standalone.rs @@ -87,6 +87,7 @@ impl StandaloneCluster { }); StandaloneCluster::wait_for_scope(config.clone()).await; StandaloneCluster::wait_for_collection(config.clone()).await; + StandaloneCluster::wait_for_kv(config.clone()).await; Self { config } } @@ -119,6 +120,26 @@ impl StandaloneCluster { }); } + async fn wait_for_kv(config: Arc) { + playground::CBPlayground::setup("wait_for_kv", config, None, |dirs, sandbox| { + let cmd = r#"doc upsert wait_for_kv {"test": "test"} | first | to json"#; + sandbox.retry_until( + Instant::now().add(time::Duration::from_secs(30)), + time::Duration::from_millis(200), + cmd, + dirs.test(), + RetryExpectations::ExpectOut, + |json| -> TestResult { + let v = json.as_object().unwrap(); + match v.get("success") { + Some(i) => Ok(i.as_i64().unwrap() == 1), + None => Ok(false), + } + }, + ); + }); + } + async fn wait_for_collection(config: Arc) { let scope_name = match config.scope() { None => {