diff --git a/src/logs/recording.rs b/src/logs/recording.rs index 42eeb431..3e7e6b26 100644 --- a/src/logs/recording.rs +++ b/src/logs/recording.rs @@ -195,7 +195,7 @@ impl Record { self.activity_write( root, &format!("{} warning: {warning}", Kind::UserConfig), - Some(History::Kind(Kind::UserConfig)), + Some(Kind::UserConfig), ); } } @@ -393,7 +393,7 @@ impl Record { self.activity_write( &self.root(repo), &format!("{kind} skipped: {reason}"), - Some(History::Kind(kind)), + Some(kind), ); } @@ -416,7 +416,7 @@ impl Record { } else { History::Kind(Kind::Process) }; - self.activity_write( + self.activity_write_with_history( &root, &format!("Process {name} skipped: {reason}"), Some(history), @@ -822,7 +822,16 @@ impl Record { } } - fn activity_write(&mut self, root: &Path, line: &str, unless_last_of: Option>) { + fn activity_write(&mut self, root: &Path, line: &str, unless_last_of: Option) { + self.activity_write_with_history(root, line, unless_last_of.map(History::Kind)); + } + + fn activity_write_with_history( + &mut self, + root: &Path, + line: &str, + unless_last_of: Option>, + ) { let appended = self.activity_append(&root.join(activity::FILE), line, unless_last_of); if let Err(error) = appended && !self.activity_warned diff --git a/tests/console/github.rs b/tests/console/github.rs index 046812c5..1239ed01 100644 --- a/tests/console/github.rs +++ b/tests/console/github.rs @@ -611,13 +611,12 @@ fn console_and_status_share_both_quota_reserves_and_resume_at_reset() { ); gh["rate_limits"][resource]["remaining"] = json!(5000); scenario.write_gh_state(&gh); + pr_is(&scenario, "MERGED"); let mut stream = events(&console); - loop { - assert!(sse_event(&mut stream).contains("event: commands")); - if !console.get("/").text().unwrap().contains(description) { - break; - } - } + // The warning expires with the clock; the row moves only after the + // background read resumes and observes the merged pull request. + wait_for(&console, &mut stream, "resolved"); + assert!(!console.get("/").text().unwrap().contains(description)); assert!(scenario.gh_calls_of("api", "graphql").len() >= 2); drop(stream); drop(console);