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.
This commit is contained in:
Taksh 2026-08-17 10:49:46 +05:30
parent 16e0a3d090
commit 83acfc4510

View File

@ -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() {