dns-test: make NameServer's FQDN more stable
previously, the FQDN of a NameServer was generated using a globally shared, monotonically increasing counter. that resulted in a unpredictable FQDN in the presence other tests running concurrently / in parallel with this change, the presence of other test threads does not affect the FQDN automatically chosen for a NameServer. the FQDN becomes only a function of the order in which the NameServers are created *within a thread*
This commit is contained in:
parent
ed192864f3
commit
e585bf0a41
|
@ -317,8 +317,10 @@ fn zone_file_path() -> String {
|
|||
}
|
||||
|
||||
fn ns_count() -> usize {
|
||||
static COUNT: AtomicUsize = AtomicUsize::new(0);
|
||||
COUNT.fetch_add(1, atomic::Ordering::Relaxed)
|
||||
thread_local! {
|
||||
static COUNT: AtomicUsize = const { AtomicUsize::new(0) };
|
||||
}
|
||||
COUNT.with(|count| count.fetch_add(1, atomic::Ordering::Relaxed))
|
||||
}
|
||||
|
||||
impl NameServer<Signed> {
|
||||
|
|
Loading…
Reference in New Issue
Block a user