fix: Fixes sensor service test that was flaky and moves docker stuff into it's own directory.
Some checks failed
CI / Run Tests (push) Failing after 12s

This commit is contained in:
2024-11-14 21:24:23 -05:00
parent ec3cd40fef
commit d4b6f6ad2b
8 changed files with 23 additions and 73 deletions

View File

@@ -52,7 +52,16 @@ final class SensorsClientTests: XCTestCase {
try await manager.withClient { client in
try await client.disconnect()
try await client.connect()
try await Task.sleep(for: .milliseconds(100))
while !client.isActive() {
try await Task.sleep(for: .milliseconds(100))
}
// Give time to re-subscribe.
while !(await sensorsService.isListening) {
try await Task.sleep(for: .milliseconds(100))
}
try await client.publish(
to: sensor.topics.temperature,
payload: ByteBufferAllocator().buffer(string: "25"),