Skip to content

fix(test-eth-config): restore link.timeout after version-5 validation tests - #14931

Merged
OhadMeir merged 1 commit into
realsenseai:developmentfrom
ghu3:fix/eth-config-test-restore-link-timeout
Apr 15, 2026
Merged

OhadMeir merged 1 commit into
realsenseai:developmentfrom
ghu3:fix/eth-config-test-restore-link-timeout

Conversation

@ghu3

@ghu3 ghu3 commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Problem

test-eth-config.py fails on three tests after PR soc-rs-soc-io-drivers#172 bumps ETH_CONFIG_VERSION from 4 → 5:

  • Test MTU configuration
  • Test transmission delay configuration
  • Test UDP TTL configuration

All fail with:

ValueError: Link timeout must be divisible by 100. Current 2345

Root Cause

The Test link timeout configuration closure, when header.version >= 5, tests invalid timeout values including 2345. After each set_eth_config() call raises ValueError, the exception path is caught correctly—but new_config.link.timeout is left at 2345 (never restored).

Previously this code path was unreachable (header.version was 4), so the bug was dormant. With version 5, the block is now executed, leaving the config object in an invalid state for all subsequent closures.

Every later closure calls set_eth_config(new_config) → build_command() → validate(), which rejects the stale invalid link.timeout before reaching the field each test actually changes.

Fix

Add a restore line at the end of the link timeout closure, consistent with the pattern used by MTU, transmission_delay, and udp_ttl closures:

new_config.link.timeout = orig_config.link.timeout  # Restore field that might fail other tests, depending header version.

Note: This is a latent bug in the test, not in the firmware or the io-drivers PR itself.

… tests

When eth_config header.version >= 5, the link timeout closure tests
several invalid values (1000, 31000, 2345) to verify ValueError is
raised. However, new_config.link.timeout was left at 2345 (invalid)
after the closure, causing every subsequent test closure (MTU,
transmission delay, UDP TTL) to fail with:

  ValueError: Link timeout must be divisible by 100. Current 2345

This was a latent bug that became visible when io-drivers PR realsenseai#172
bumped ETH_CONFIG_VERSION from 4 to 5, activating the previously
unreachable version-5 branch.

Fix: restore new_config.link.timeout to orig_config.link.timeout at
the end of the link timeout closure, consistent with how MTU,
transmission_delay, and udp_ttl closures already restore their fields.
Copilot AI review requested due to automatic review settings April 15, 2026 09:47
@sysrsbuild-gh

Copy link
Copy Markdown

Can one of the admins verify this patch?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a test isolation bug in test-eth-config.py where the “Test link timeout configuration” closure (for ETH_CONFIG_VERSION >= 5) leaves new_config.link.timeout set to an intentionally-invalid value after validation tests, causing subsequent closures to fail validation before reaching their target fields.

Changes:

  • Restore new_config.link.timeout to orig_config.link.timeout at the end of the link-timeout closure to prevent cascading failures in later tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ghu3
ghu3 changed the base branch from master to development April 15, 2026 10:04
@Nir-Az
Nir-Az requested a review from OhadMeir April 15, 2026 10:50
@OhadMeir
OhadMeir merged commit eb83a05 into realsenseai:development Apr 15, 2026
29 of 30 checks passed
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.

5 participants