Skip to content

Commit 4212583

Browse files
committed
De-flake unit tests
1 parent 154298c commit 4212583

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

.swiftpm/xcode/xcshareddata/xcschemes/OSCKit-CI.xcscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@
8282
</BuildableReference>
8383
</TestableReference>
8484
<TestableReference
85-
skipped = "NO">
85+
skipped = "NO"
86+
parallelizable = "NO">
8687
<BuildableReference
8788
BuildableIdentifier = "primary"
8889
BlueprintIdentifier = "OSCKitTests"

Tests/OSCKitTests/OSCServer Tests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct OSCServer_Tests {
3131
}
3232

3333
/// Ensure rapidly received messages are dispatched in the order they are received.
34-
@Test(arguments: 0 ... 10)
34+
@MainActor @Test(arguments: 0 ... 10)
3535
func messageOrdering(iteration: Int) async throws {
3636
_ = iteration // argument value not used, just a mechanism to repeat the test X number of times
3737

@@ -83,7 +83,7 @@ struct OSCServer_Tests {
8383
}
8484

8585
/// Offline stress-test to ensure a large volume of OSC packets are received and dispatched in order.
86-
@Test
86+
@MainActor @Test
8787
func stressTestOffline() async throws {
8888
let server = OSCServer()
8989

@@ -126,7 +126,7 @@ struct OSCServer_Tests {
126126
}
127127

128128
/// Online stress-test to ensure a large volume of OSC packets are received and dispatched in order.
129-
@Test
129+
@MainActor @Test
130130
func stressTestOnline() async throws {
131131
let isFlakey = !isSystemTimingStable()
132132

Tests/OSCKitTests/OSCSocket Tests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ struct OSCSocket_Tests {
3131
}
3232

3333
/// Ensure rapidly received messages are dispatched in the order they are received.
34-
@Test(arguments: 0 ... 10)
34+
@MainActor @Test(arguments: 0 ... 10)
3535
func messageOrdering(iteration: Int) async throws {
3636
_ = iteration // argument value not used, just a mechanism to repeat the test X number of times
3737

@@ -83,7 +83,7 @@ struct OSCSocket_Tests {
8383
}
8484

8585
/// Offline stress-test to ensure a large volume of OSC packets are received and dispatched in order.
86-
@Test
86+
@MainActor @Test
8787
func stressTestOffline() async throws {
8888
let socket = OSCSocket(
8989
localPort: nil,
@@ -135,7 +135,7 @@ struct OSCSocket_Tests {
135135
}
136136

137137
/// Online stress-test to ensure a large volume of OSC packets are received and dispatched in order.
138-
@Test
138+
@MainActor @Test
139139
func stressTestOnline() async throws {
140140
let isFlakey = !isSystemTimingStable()
141141

0 commit comments

Comments
 (0)