Skip to content

fix: resolve Windows test-suite issues, cloud push logging, and dynamic midpoint fallback - #226

Open
dieterolson wants to merge 1 commit into
open-flight:mainfrom
dieterolson:fix/windows-suite-and-upstream-fixes
Open

fix: resolve Windows test-suite issues, cloud push logging, and dynamic midpoint fallback#226
dieterolson wants to merge 1 commit into
open-flight:mainfrom
dieterolson:fix/windows-suite-and-upstream-fixes

Conversation

@dieterolson

Copy link
Copy Markdown
Contributor

Summary

Resolves Issue #15 (Windows test-suite fixes) and Issue #17 (verified upstream code fixes):

1. Windows Test Suite Fixes (Issue #15)

  • tests/test_compare_trackman.py: Added newline="" to path.write_text(...) to prevent Windows CRLF automatic conversion from causing CRCRLF line-ending mismatch.
  • tests/test_cloud_config.py: Skipped POSIX permission bits assertion on Windows where 0600 is not representable.
  • tests/test_serial_latency.py: Skipped udev symlink resolution test on Windows where symlink creation requires elevation.
  • tests/test_sim_transport.py: Replaced sleep-based backoff timing test with deterministic monkeypatched instant refusal socket and polling loop.
  • tests/conftest.py: Handled OSError on MockSimServer.accept() loop to allow clean and immediate shutdown upon socket closure during teardown without PytestUnhandledThreadExceptionWarning.
  • pyproject.toml & .gitignore: Configured addopts = "--basetemp=.pytest_temp" and tmp_path_retention_policy = "none" under [tool.pytest.ini_options] and ignored .pytest_temp/ to prevent Windows temp directory locking permission issues.

2. Code Fixes (Issue #17)

  • src/openflight/server.py: Replaced silent exception swallow in _fire_cloud_push with logger.debug("[SERVER] Cloud push trigger failed", exc_info=True).
  • src/openflight/rolling_buffer/processor.py: Dynamically computed the capture midpoint fallback timestamp from (len(capture.i_samples) / self.SAMPLE_RATE) * 500.0 instead of a hardcoded 68.0 ms.
  • src/openflight/kld7/radc.py & src/openflight/server.py: Defined and deduplicated DEFAULT_RADC_HORIZONTAL_ANGLE_LIMIT_DEG = 15.0.
  • src/openflight/kld7/__init__.py & src/openflight/kld7/tracker.py: Moved the K-LD7 deprecation warning from the top-level __init__.py to KLD7Tracker.__init__ so importing sibling modules or session_logger does not emit deprecation warnings.

Verification

  • Full pytest test suite passes: 1233 passed, 10 skipped cleanly with 0 failures.
  • ruff check and ruff format --check pass with 0 errors.
  • pylint scores 9.70/10.

…ic midpoint fallback

Windows test-suite fixes: newline preservation in compare_trackman, Windows skips for POSIX permissions and symlinks, deterministic sim transport backoff, clean socket accept termination, and tmp_path basetemp config. Code fixes: cloud-push debug logging, dynamic capture midpoint calculation, and deduplicated angle limit constant.
@dieterolson
dieterolson requested a review from jewbetcha as a code owner August 21, 2026 05:30
@jewbetcha

Copy link
Copy Markdown
Member

Good to go after conflicts resolved

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.

2 participants