test(server): use native timespec bounds #110

Merged
Lochnair merged 1 commits from fix/server-i686-timespec-test into main 2026-08-16 15:06:29 +00:00
Lochnair commented 2026-08-15 17:10:41 +00:00 (Migrated from github.com)

Summary

  • use target-native time_t / c_long extrema in the Linux timestamp conversion test;
  • restore test compilation on i686-unknown-linux-gnu;
  • leave production timestamp and ancillary behavior unchanged.

Bug

The test used i64::MIN and i64::MAX as arguments to TimeSpec::new.

On 64-bit Linux those happen to match the native argument widths, but on
i686-unknown-linux-gnu time_t and c_long are 32-bit, so the test failed
to compile with expected i32, found i64.

Fix

Use the actual target-native libc bounds:

libc::time_t::MIN
libc::c_long::MIN
libc::time_t::MAX

Production impact

None. The production conversion already uses checked width-independent
conversions.

Linux verification

Validation ran in an OrbStack Ubuntu 26.04 x86_64 machine using Linux rustc
1.97.1 and cargo 1.97.1 with the i686-unknown-linux-gnu target.

  • workspace i686 cargo check --all-targets --all-features --locked: passed;
  • focused i686 timestamp-conversion runtime test: passed;
  • produced test executable: ELF 32-bit ... Intel i386;
  • native x86_64 Linux irtt-server suite: passed.

The full i686 irtt-server suite has two known, environment-specific OrbStack
failures: its translated i686 process receives errno 92 enabling
SO_TIMESTAMPNS. Native x86_64 succeeds; temporary 32-bit C and Rust/nix
probes reproduce the same refusal. This is independent of this compile-only
test fix and production timestamp setup is best effort.

Host verification

  • cargo test -p irtt-server --all-features --locked
  • cargo fmt --all -- --check
  • cargo check --workspace --all-targets --all-features --locked
  • cargo test --workspace --all-targets --all-features --locked
  • cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
  • RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps --locked
  • git diff --check

Scope

No production code, ancillary semantic, dependency, or Cargo.lock changes.

## Summary - use target-native `time_t` / `c_long` extrema in the Linux timestamp conversion test; - restore test compilation on `i686-unknown-linux-gnu`; - leave production timestamp and ancillary behavior unchanged. ## Bug The test used `i64::MIN` and `i64::MAX` as arguments to `TimeSpec::new`. On 64-bit Linux those happen to match the native argument widths, but on `i686-unknown-linux-gnu` `time_t` and `c_long` are 32-bit, so the test failed to compile with `expected i32, found i64`. ## Fix Use the actual target-native libc bounds: ```rust libc::time_t::MIN libc::c_long::MIN libc::time_t::MAX ``` ## Production impact None. The production conversion already uses checked width-independent conversions. ## Linux verification Validation ran in an OrbStack Ubuntu 26.04 x86_64 machine using Linux rustc 1.97.1 and cargo 1.97.1 with the `i686-unknown-linux-gnu` target. - workspace i686 `cargo check --all-targets --all-features --locked`: passed; - focused i686 timestamp-conversion runtime test: passed; - produced test executable: `ELF 32-bit ... Intel i386`; - native x86_64 Linux `irtt-server` suite: passed. The full i686 `irtt-server` suite has two known, environment-specific OrbStack failures: its translated i686 process receives errno 92 enabling `SO_TIMESTAMPNS`. Native x86_64 succeeds; temporary 32-bit C and Rust/nix probes reproduce the same refusal. This is independent of this compile-only test fix and production timestamp setup is best effort. ## Host verification - `cargo test -p irtt-server --all-features --locked` - `cargo fmt --all -- --check` - `cargo check --workspace --all-targets --all-features --locked` - `cargo test --workspace --all-targets --all-features --locked` - `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` - `RUSTDOCFLAGS="-D warnings" cargo doc --workspace --all-features --no-deps --locked` - `git diff --check` ## Scope No production code, ancillary semantic, dependency, or `Cargo.lock` changes.
Sign in to join this conversation.