Skip to content

test: SendSpinClient state, reconnect, and network tests#74

Merged
chrisuthe merged 2 commits intomainfrom
test/sendspin-client-state-reconnect
Mar 8, 2026
Merged

test: SendSpinClient state, reconnect, and network tests#74
chrisuthe merged 2 commits intomainfrom
test/sendspin-client-state-reconnect

Conversation

@chrisuthe
Copy link
Copy Markdown
Owner

Summary

  • SendSpinClientConnectionStateTest: Verifies ConnectionState flows through Disconnected -> Connecting -> Connected -> Error lifecycle correctly
  • SendSpinClientReconnectBackoffTest: Verifies exponential backoff delays (500ms, 1s, 2s, 4s, 8s), max 5 attempts in normal mode, and infinite retries with 30s steady-state in high power mode
  • SendSpinClientTimeFilterFreezeTest: Verifies timeFilter.freeze() is called on first reconnect attempt and thaw() on handshake complete, preserving clock sync across network drops
  • SendSpinClientNetworkPauseTest: Verifies reconnection pauses when networkAvailable=false without wasting attempts and resumes immediately when networkAvailable=true

Test plan

  • Run ./gradlew test to verify all new tests pass
  • Verify no regressions in existing SendSpinClientDisconnectTest
  • Review test coverage of attemptReconnect() edge cases (user-initiated disconnect, high power mode)

Add SendSpinClientConnectionStateTest verifying Disconnected->Connecting->
Connected->Error transitions through the client lifecycle.

Add SendSpinClientReconnectBackoffTest verifying exponential backoff delays
(500ms, 1s, 2s, 4s, 8s), max 5 attempts in normal mode, and infinite
retries with 30s steady-state in high power mode.
@chrisuthe chrisuthe merged commit ec26b99 into main Mar 8, 2026
Add SendSpinClientTimeFilterFreezeTest verifying freeze() is called on
first reconnect attempt and thaw() on successful handshake completion,
preserving clock sync across network drops.

Add SendSpinClientNetworkPauseTest verifying reconnection pauses when
networkAvailable=false (without wasting attempts) and resumes when
networkAvailable=true.
@chrisuthe chrisuthe deleted the test/sendspin-client-state-reconnect branch March 12, 2026 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant