mirror of
https://github.com/permissionlesstech/bitchat.git
synced 2026-11-01 07:53:26 +00:00
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:
parent
16e0a3d090
commit
83acfc4510
@ -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() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user