Skip to content

Commit eb292da

Browse files
fix(test): the content-cache answer for a repeated payload is not a defect
Every file the writer produces carries the same bytes, so once the content cache has seen them content_changed is legitimately false for the rest -- and the settled event this test now selects can be one of those. The claim moves to where it is actually true: the first sight of those bytes.
1 parent 174b087 commit eb292da

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

  • src/daemon/retrigger-daemon/tests

src/daemon/retrigger-daemon/tests/api.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,6 @@ async fn a_file_change_reaches_a_subscriber_with_the_xxh3_digest() -> Result<()>
390390
Some(expected),
391391
"the daemon must report the XXH3-64 digest from retrigger-core, got {event:#}"
392392
);
393-
assert_eq!(event["content_changed"], true);
394393
assert!(
395394
event["event"]["path"]
396395
.as_str()
@@ -399,6 +398,15 @@ async fn a_file_change_reaches_a_subscriber_with_the_xxh3_digest() -> Result<()>
399398
"the event should name the file that changed: {event:#}"
400399
);
401400

401+
// Asserted on the first event rather than on the settled one. Every file the writer produces
402+
// carries the same bytes, so once the content cache has seen them `false` is the correct
403+
// answer for the rest — the claim worth making is that their first appearance was a change.
404+
let first = events.first().context("the subscriber received nothing")?;
405+
assert_eq!(
406+
first["content_changed"], true,
407+
"the first sight of these bytes must be reported as a content change, got {first:#}"
408+
);
409+
402410
harness.shutdown().await
403411
}
404412

0 commit comments

Comments
 (0)