Skip to content

test: Characterize portal sleep inhibitor lifecycle - #1633

Merged
zackees merged 1 commit into
obs-rust:masterfrom
nathan-v:test/platform-nix-portal-characterization
Oct 21, 2026
Merged

zackees merged 1 commit into
obs-rust:masterfrom
nathan-v:test/platform-nix-portal-characterization

Conversation

@nathan-v

@nathan-v nathan-v commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1631

What and why

Add nine deterministic C characterization cases for the portal sleep inhibitor before its Rust port. They pin discovery failure/success, request fields and sender path, repeated activation, success/denial/error responses, retry, cancellation, response-before-reply ordering, and destruction with pending Inhibit/Close callbacks. Allocation-count assertions check that callback-owned inhibitor storage is released.

The test includes the unchanged original C source because these entry points are hidden. It uses real GLib variants, cancellables and reference counts with a fake D-Bus transport; it does not contact a desktop or sleep. This is source-only characterization, not proof of the future Rust swap. The existing public-API test_inhibit_sleep_dbus remains unchanged and supplies OFF/ON integration coverage.

Validation

  • Characterization-only prerequisite under testing-policy.md: no Rust stubs or implementation in this PR. The port's RED/GREEN commits follow separately.
  • Native focused compile with -Wall -Wextra -Werror: nine cases pass, also under AddressSanitizer/UBSan.
  • Mutation check on a temporary source copy: changing inhibit flags from 0xC to 0x4 fails test_request_and_success (4 != 12); production source unchanged.
  • Formatting checks pass.
  • Linux focused OFF/ON: all nine cases pass, plus 100 repetitions per mode; ldd confirmed /build/tree/libobs and /build/tree/libobs-with-rust respectively. The unchanged test_inhibit_sleep_dbus also passes all 10 cases in both modes. Local libobs C/Rust exported symbols are identical.
  • Stopped the duplicate local full-suite run after focused validation; hosted CI runs the required complete suite. No full local-suite pass claimed.
  • Hosted CI passes at 647df0f: Fast Gate, formatting, Tier 2 build, all four OFF/ON shards and CI Gate. Run 39648949440.
  • Local full lint is blocked by host-dependent existing CI self-tests (Linux linker/readelf assumptions, macOS platform-header conflicts and /var versus /private/var path expectations). No local gate attestation claimed; PR CI is the merge gate.

No production changes, public-header edits, existing C-test edits, or user-visible behavior change.

Checklist

@nathan-v
nathan-v marked this pull request as ready for review October 21, 2026 18:13
@nathan-v
nathan-v requested a review from zackees as a code owner October 21, 2026 18:13
@zackees
zackees added this pull request to the merge queue Oct 21, 2026
Merged via the queue into obs-rust:master with commit 734ae28 Oct 21, 2026
25 checks passed
@vpacher vpacher mentioned this pull request Oct 21, 2026
5 tasks done
@nathan-v nathan-v mentioned this pull request Oct 21, 2026
6 of 7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants