Skip to content

test(openrgb): make timing fixtures deterministic - #281

Merged
hyperb1iss merged 2 commits into
mainfrom
nova/openrgb-cadence-fixture
Sep 8, 2026
Merged

test(openrgb): make timing fixtures deterministic#281
hyperb1iss merged 2 commits into
mainfrom
nova/openrgb-cadence-fixture

Conversation

@hyperb1iss

@hyperb1iss hyperb1iss commented Sep 8, 2026

Copy link
Copy Markdown
Owner

The OpenRGB cadence and handshake fixtures now measure controlled Tokio time instead of host scheduling delays. Previously, a busy Windows runner could count too few frames or exhaust the 20ms discovery timeout before reaching the handshake assertion.

The repair preserves 100fps/5fps controller rates, the 300ms cadence window, original frame thresholds, and the configured 20ms handshake deadline. Socket observations establish progress; a real-time watchdog diagnoses stalls. The handshake remains pending at 19ms and returns the exact configured timeout after crossing Tokio's timer boundary.

Injected scheduling and discovery delays reproduce the old failures and pass with the repair. A deliberately throttled fast controller still fails. All 65 crate tests, scoped Clippy, and formatting pass; independent review reran all 31 integration tests successfully. Production behavior is unchanged, and Tokio's test utilities are a development-only dependency feature.

The changelog also corrects the diagnostics command and distinguishes retired trait-method compile errors from unsupported display output. The refreshed 0.5.0 tag passed all validation gates. Both repaired OpenRGB fixtures passed in the Windows shared suite, alongside the native macOS, Servo, and end-to-end checks.

hyperb1iss and others added 2 commits September 8, 2026 11:42
Use controlled Tokio time and observed socket progress so scheduler
latency cannot consume the cadence window or expire discovery before
the handshake assertion. Preserve the 100/5 FPS rates, frame thresholds,
and configured 20 ms handshake timeout.

A real-time watchdog diagnoses stalled fixtures without defining their
timing contract. Delayed discovery and scheduling reproduce the old
failures, while a throttled-controller mutation still fails the repair.

Co-Authored-By: Nova (GPT-6) <noreply@openai.com>
Use the existing OpenRGB diagnostics command and distinguish retired
trait-method compile errors from the replacement method defaulting to
unsupported display output. Keep upgrade guidance aligned with the CLI
and driver API shipped in the release.

Co-Authored-By: Nova (GPT-6) <noreply@openai.com>
@hyperb1iss
hyperb1iss merged commit 5902542 into main Sep 8, 2026
12 of 19 checks passed
@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1c3158cf-75cf-486d-9065-091b84826a88

📥 Commits

Reviewing files that changed from the base of the PR and between e320794 and 80cbc75.

📒 Files selected for processing (3)
  • CHANGELOG.md
  • crates/hypercolor-driver-openrgb/Cargo.toml
  • crates/hypercolor-driver-openrgb/tests/openrgb_driver_tests.rs

📝 Walkthrough

Walkthrough

The changes make OpenRGB driver timing tests deterministic with Tokio virtual time and real-time watchdogs. They add update observation channels, strengthen handshake-timeout assertions, enable Tokio test utilities, and update two changelog entries.

Changes

OpenRGB test determinism

Layer / File(s) Summary
Deterministic handshake timeout
crates/hypercolor-driver-openrgb/Cargo.toml, crates/hypercolor-driver-openrgb/tests/openrgb_driver_tests.rs
The timeout fixture pauses Tokio time, coordinates handshake receipt, advances the configured deadline, and verifies socket closure.
Observed controller cadence
crates/hypercolor-driver-openrgb/tests/openrgb_driver_tests.rs
The cadence test records LED updates through a channel and checks fast and slow controller intervals with virtual-time steps.
Release note updates
CHANGELOG.md
The changelog updates the OpenRGB diagnostic command and the DeviceBackend display-write guidance.

Estimated code review effort: 3 (Moderate) | ~20 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

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