Skip to content

feat : Run MetaDrive simulation test in GitHub Actions#37729

Open
mahmudsudo wants to merge 18 commits intocommaai:masterfrom
mahmudsudo:simTest
Open

feat : Run MetaDrive simulation test in GitHub Actions#37729
mahmudsudo wants to merge 18 commits intocommaai:masterfrom
mahmudsudo:simTest

Conversation

@mahmudsudo
Copy link
Copy Markdown

@mahmudsudo mahmudsudo commented Mar 25, 2026

Description

This PR implements the requirements for running the MetaDrive simulation test reliably in GitHub Actions, addressing and closes #30693.

Changes include:

  1. Real-time execution fix: Fixed a CPU starvation issue in test_sim_bridge.py where a while busy loop (continue) was consuming a full CPU core. On 2-core GitHub Action runners, this starved openpilot processes, causing the test to lag behind real-time and eventually timeout. Replaced with time.sleep(0.1) to allow Ratekeeper to maintain proper real-time execution.
  2. Logs & Artifacts: Added a RECORD environment variable to launch_openpilot.sh to unblock loggerd and encoderd. This allows openpilot to capture qlog, rlog, and camera files during the simulation.
  3. Execution setup: Made test_duration configurable via TEST_DURATION in test_metadrive_bridge.py.
  4. CI Integration: Re-enabled the simulator_driving job in tests.yaml. It now runs for a full 60 seconds (TEST_DURATION=60), passes RECORD=1, and uploads the ~/.comma/media/0/realdata/ directory as a GitHub Artifact upon completion.

Verification

  • Verified that the simulator_driving job now successfully completes 1 minute of driving without timing out on standard GitHub Action runners.
  • Confirmed that Ratekeeper no longer lags behind real-time.
  • Verified that the metadrive_logs artifact is correctly generated and contains the expected qlog, rlog, and .hevc camera files.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 25, 2026

Process replay diff report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ 0 changed, 66 passed, 0 errors

@mahmudsudo
Copy link
Copy Markdown
Author

@adeebshihadeh

@TheSecurityDev
Copy link
Copy Markdown
Contributor

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.

Run MetaDrive simulation test in GitHub Actions

2 participants