Initial Connect: Add unit tests to validate the initial connect state machine with respect to skipping various parts#14036
Merged
DonLakeFlyer merged 1 commit intomasterfrom Feb 26, 2026
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds explicit matrix expectations and comprehensive documentation for the InitialConnectStateMachine behavior across different link types (high-latency, log-replay) and flight states.
Changes:
- Added data-driven test
_stateRunMatrixthat validates all 8 combinations of (HighLatency, LogReplay, Flying) states - Added readable matrix tables showing expected request behavior in test comments
- Added comprehensive 374-line analysis document covering InitialConnectStateMachine behavior, skip predicates, and state transitions
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| test/Vehicle/InitialConnectTest.h | Added test method declarations for new matrix test |
| test/Vehicle/InitialConnectTest.cc | Implemented comprehensive matrix test with 8 data-driven test cases validating AUTOPILOT_VERSION, AVAILABLE_MODES, and plan request behavior across different link configurations |
| docs/en/initial-connect-state-machine-analysis.md | New comprehensive documentation covering state machine behavior, skip predicates, timeouts, progress tracking, and includes matching matrix tables |
Contributor
Build ResultsPlatform Status
Some builds failed. Pre-commit
Pre-commit hooks: 32 passed, 78 failed, 10 skipped. Test Resultslinux-sanitizers: 51 passed, 0 skipped linux_gcc_64: 51 passed, 0 skipped Total: 102 passed, 0 skipped Code CoverageCoverage: N/A No baseline available for comparison Artifact Sizes
No baseline available for comparison Updated: 2026-02-26 20:34:24 UTC • Triggered by: MacOS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a data-driven unit test that validates InitialConnectStateMachine skip behavior across all combinations of HighLatency, LogReplay, and Flying link flags. The test generates an 8-row matrix (3 boolean dimensions) and asserts which MAVLink request traffic occurs for each combination:
highLatency || logReplayhighLatency || logReplayNote that 'flying' is not yet used. Working on that...
Also adds an analysis document covering the full initial connect pipeline: state ordering, retry/timeout behavior, skip predicates, progress weighting, and data captured at each stage.
Related to #13861
Test plan
InitialConnectTest::_stateRunMatrixpasses locally across all 8 matrix rowsInitialConnectTestcases continue to pass