20afe11b
Rebase onto main (revision-refs) and fix test flakiness found in the process
a73x 2026-08-10 06:04
Commit message
tests/cache_test.rs
| Old | New | ||
|---|---|---|---|
| @@ -2,6 +2,7 @@ mod common; | |||
| 2 | 2 | ||
| 3 | use common::{ | 3 | use common::{ |
| 4 | add_comment, add_review, alice, bob, close_issue, create_patch, init_repo, open_issue, | 4 | add_comment, add_review, alice, bob, close_issue, create_patch, init_repo, open_issue, |
| 5 | ScopedTestConfig, | ||
| 5 | }; | 6 | }; |
| 6 | use git_collab::cache; | 7 | use git_collab::cache; |
| 7 | use git_collab::event::ReviewVerdict; | 8 | use git_collab::event::ReviewVerdict; |
| @@ -228,6 +229,13 @@ fn stale_v3_patch_cache_entry_missing_labels_is_a_miss() { | |||
| 228 | // the label silently dropped, rather than forcing a refold. Bumping | 229 | // the label silently dropped, rather than forcing a refold. Bumping |
| 229 | // CACHE_FORMAT_VERSION to 4 closes that: any v3-tagged entry is | 230 | // CACHE_FORMAT_VERSION to 4 closes that: any v3-tagged entry is |
| 230 | // rejected outright, regardless of which fields it happens to have. | 231 | // rejected outright, regardless of which fields it happens to have. |
| 232 | // | ||
| 233 | // `patch::label` signs its event through the real signing-key path | ||
| 234 | // (`HOME`/`XDG_CONFIG_HOME`), unlike the other helpers in this file | ||
| 235 | // which sign with an in-memory test key -- so it needs `ScopedTestConfig` | ||
| 236 | // to avoid racing other tests that mutate those same env vars. | ||
| 237 | let cfg = ScopedTestConfig::new(); | ||
| 238 | cfg.ensure_signing_key(); | ||
| 231 | let dir = TempDir::new().unwrap(); | 239 | let dir = TempDir::new().unwrap(); |
| 232 | let repo = init_repo(dir.path(), &alice()); | 240 | let repo = init_repo(dir.path(), &alice()); |
| 233 | let (ref_name, id) = create_patch(&repo, &alice(), "Cache label test"); | 241 | let (ref_name, id) = create_patch(&repo, &alice(), "Cache label test"); |
tests/collab_test.rs
| Old | New | ||
|---|---|---|---|
| @@ -1462,6 +1462,13 @@ fn test_patch_list_to_writer_renders_labels() { | |||
| 1462 | // but, unlike issue::list_to_writer, did not render the ` [a, b]` suffix | 1462 | // but, unlike issue::list_to_writer, did not render the ` [a, b]` suffix |
| 1463 | // -- the one place a patch's labels were silently dropped. Regression | 1463 | // -- the one place a patch's labels were silently dropped. Regression |
| 1464 | // test for that parity gap. | 1464 | // test for that parity gap. |
| 1465 | // | ||
| 1466 | // `patch::label` signs through the real signing-key path (`HOME`/ | ||
| 1467 | // `XDG_CONFIG_HOME`), unlike the other helpers used elsewhere in this | ||
| 1468 | // file, so it needs `ScopedTestConfig` to avoid racing other tests that | ||
| 1469 | // mutate those same env vars. | ||
| 1470 | let cfg = ScopedTestConfig::new(); | ||
| 1471 | cfg.ensure_signing_key(); | ||
| 1465 | let tmp = TempDir::new().unwrap(); | 1472 | let tmp = TempDir::new().unwrap(); |
| 1466 | let repo = init_repo(tmp.path(), &alice()); | 1473 | let repo = init_repo(tmp.path(), &alice()); |
| 1467 | 1474 | ||