Skip to content

Commit c232a08

Browse files
authored
tests/util/github: Fix test flakyness (#9980)
`gh_id = 0` has a special meaning within our database. Depending on the order of the tests we could sometimes see tests failing because the initial user was created with `gh_id = 0`. This commit fixes the flakiness by starting the `gh_id` values at 1 instead.
1 parent d3d908d commit c232a08

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tests/util/github.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crates_io_github::{
55
};
66
use std::sync::atomic::{AtomicUsize, Ordering};
77

8-
static NEXT_GH_ID: AtomicUsize = AtomicUsize::new(0);
8+
static NEXT_GH_ID: AtomicUsize = AtomicUsize::new(1);
99

1010
pub fn next_gh_id() -> i32 {
1111
NEXT_GH_ID.fetch_add(1, Ordering::SeqCst) as i32

0 commit comments

Comments
 (0)