Skip to content

Commit a2d148c

Browse files
lpcoxCopilot
andcommitted
fix: use unique login in error_callback test to avoid cache collision
The test_has_maintainer_reaction_backend_error_skips test was flaky because it used login 'alice' which could be cached by prior tests using admin_permission_callback. The global permission cache returned the cached 'admin' permission instead of invoking error_callback. Use 'error-test-user' to guarantee a cache miss. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3ef2a3c commit a2d148c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • guards/github-guard/rust-guard/src/labels

guards/github-guard/rust-guard/src/labels/helpers.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1881,9 +1881,11 @@ mod tests {
18811881
#[test]
18821882
fn test_has_maintainer_reaction_backend_error_skips() {
18831883
let ctx = ctx_with_endorsement_reactions(vec!["THUMBS_UP"]);
1884+
// Use a unique login to avoid hitting the global permission cache populated
1885+
// by other tests (e.g. admin_permission_callback caching "alice").
18841886
let item = serde_json::json!({
18851887
"number": 42,
1886-
"reactions": {"nodes": [{"user": {"login": "alice"}, "content": "THUMBS_UP"}]}
1888+
"reactions": {"nodes": [{"user": {"login": "error-test-user"}, "content": "THUMBS_UP"}]}
18871889
});
18881890
// Backend error → can't confirm permission → should not count as endorsement
18891891
assert!(!has_maintainer_reaction_with_callback(

0 commit comments

Comments
 (0)