From b79f5926e2556809f079c4ca1f64f5ca407af88f Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 17 Nov 2024 23:51:35 +0100 Subject: [PATCH] tests/util/github: Fix test flakyness `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. --- src/tests/util/github.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/util/github.rs b/src/tests/util/github.rs index 18bd36c82a2..58d3d45a1a7 100644 --- a/src/tests/util/github.rs +++ b/src/tests/util/github.rs @@ -5,7 +5,7 @@ use crates_io_github::{ }; use std::sync::atomic::{AtomicUsize, Ordering}; -static NEXT_GH_ID: AtomicUsize = AtomicUsize::new(0); +static NEXT_GH_ID: AtomicUsize = AtomicUsize::new(1); pub fn next_gh_id() -> i32 { NEXT_GH_ID.fetch_add(1, Ordering::SeqCst) as i32