2025-12-19 13:58:33 +00:00
|
|
|
import Testing
|
2026-01-30 03:15:10 +01:00
|
|
|
@testable import OpenClaw
|
2025-12-19 13:58:33 +00:00
|
|
|
|
2026-03-08 13:22:46 +00:00
|
|
|
struct NodePairingReconcilePolicyTests {
|
|
|
|
|
@Test func `policy polls only when active`() {
|
2025-12-19 13:58:33 +00:00
|
|
|
#expect(NodePairingReconcilePolicy.shouldPoll(pendingCount: 0, isPresenting: false) == false)
|
|
|
|
|
#expect(NodePairingReconcilePolicy.shouldPoll(pendingCount: 1, isPresenting: false))
|
|
|
|
|
#expect(NodePairingReconcilePolicy.shouldPoll(pendingCount: 0, isPresenting: true))
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-08 13:22:46 +00:00
|
|
|
@Test func `policy uses slow safety interval`() {
|
2026-01-08 02:36:29 +00:00
|
|
|
#expect(NodePairingReconcilePolicy.activeIntervalMs >= 10000)
|
2025-12-19 13:58:33 +00:00
|
|
|
}
|
|
|
|
|
}
|