~ knotless Search/
↑↓ move↵ open⇧↵ all results

chadtmiller.com/knotless

git that lives in your Atmosphere account

knotless.dev
1 collaborator

knotless 0.13.0 Latest 2 packages, 1 image

1
10

Two forge tests wait for the appview to hear another account's write

Merged chadtmiller.com asked to merge into main from chadtmiller.com/knotless:serve/forge-races
crates/knotless-serve/tests/forge.rs+10−8
@@ -2318,10 +2318,10 @@ fn assignees_and_reviews_maintainers_ask_for() {
ok(&owner, &["ask-review", &url, &pull, theirs]),
theirs.as_str()
);
assert_eq!(
ok(&author, &["ask-review", &url, &pull, mine]),
format!("{mine}\n{theirs}")
);
// The author reads the owner's ask through the appview, once it
// hears of it; asking again asks no more.
let both = format!("{mine}\n{theirs}");
wait_until(|| ok(&author, &["ask-review", &url, &pull, mine]) == both);
refused(
&author,
&["unask-review", &url, &pull, theirs],
@@ -2435,21 +2435,23 @@ fn maintainers_dismiss_reviews() {
// gate holds the pull no more.
let dismissal = ok(&owner, &["dismiss", &url, &pull, gate, "Fixed in review"]);
assert!(dismissal.contains("/dev.knotless.comment/"), "{dismissal}");
let shown = ok(&collab, &["show", &url, &pull]);
// Another reads the dismissal once the appview hears of it.
let show = || ok(&collab, &["show", &url, &pull]);
wait_until(|| show().contains(", dismissed\n"));
let shown = show();
assert!(
shown.contains(&format!("review: {gate} changes at ")),
"{shown}"
);
assert!(shown.contains(", dismissed\n"), "{shown}");
assert!(!blocked(&collab));
refused(
&collab,
&["dismiss", &url, &pull, gate, "Again"],
"has no standing review",
);
// Its next review stands again.
// Its next review stands again, once the appview hears of it.
ok(&bot, &["comment", &url, &pull, "Still not", "--changes"]);
assert!(blocked(&owner));
wait_until(|| blocked(&owner));
ok(&collab, &["dismiss", &url, &pull, gate, "Fine by me"]);
assert!(!blocked(&owner));
crates/knotless-serve/tests/forge.rsline 2456

This reads the collaborator's dismissal as the owner with no wait, so it can flake like the cases fixed above. Consider wait_until(|| !blocked(&owner)).

}