From 83acfc4510d04719b518131de2b25a8602b1a99f Mon Sep 17 00:00:00 2001 From: Taksh Date: Mon, 17 Aug 2026 10:49:46 +0530 Subject: [PATCH] test: serialize the peer colour cache suite The compute-count assertions read a process-global counter, and swift testing runs a suite's tests in parallel by default, so one test computing a colour between another's two reads would fail it for a reason that has nothing to do with the cache. The seeds are unique per test; the counter is not. No other test touches _peerColorComputeCountForTesting, so serializing this suite is enough. --- bitchatTests/Utils/ColorPeerTests.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bitchatTests/Utils/ColorPeerTests.swift b/bitchatTests/Utils/ColorPeerTests.swift index 023459ee..12de5185 100644 --- a/bitchatTests/Utils/ColorPeerTests.swift +++ b/bitchatTests/Utils/ColorPeerTests.swift @@ -9,6 +9,10 @@ import Testing import SwiftUI @testable import bitchat +/// Serialized: the compute-count assertions read a process-global counter, +/// so a sibling test computing a colour between two reads would fail them for +/// the wrong reason. The seeds are unique per test, but the counter is not. +@Suite(.serialized) struct ColorPeerTests { @Test func repeatedSeedHitsCacheInsteadOfRecomputing() {