MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / wait_for_log

Method wait_for_log

atomic-cli/tests/it/git_shim_logging_test.rs:100–113  ·  view source on GitHub ↗

Wait until a log line contains every needle.

(&self, needles: &[&str])

Source from the content-addressed store, hash-verified

98impl Sandbox {
99 /// Wait until a log line contains every needle.
100 fn wait_for_log(&self, needles: &[&str]) {
101 let deadline = Instant::now() + Duration::from_secs(20);
102 while Instant::now() < deadline {
103 let log = self.log();
104 if log
105 .lines()
106 .any(|line| needles.iter().all(|needle| line.contains(needle)))
107 {
108 return;
109 }
110 thread::sleep(Duration::from_millis(50));
111 }
112 panic!("no line with {needles:?} in:\n{}", self.log());
113 }
114}
115
116/// The first log line containing every needle.

Callers 1

shim_feature_commitFunction · 0.80

Calls 5

logMethod · 0.45
linesMethod · 0.45
allMethod · 0.45
iterMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected