Skip to content

Add timeout behavior E2E tests for device-profiler #368

@groupsky

Description

@groupsky

Description

Add E2E test coverage for device-profiler timeout configuration and behavior.

Context

PR #366 adds device-profiler E2E tests but doesn't cover the --timeout parameter or timeout error scenarios. The profiler supports configurable response timeouts (default 1000ms), but timeout behavior is only covered in unit tests.

Test Scenarios

Timeout Parameter

  • Test custom timeout values
ya-modbus-profile --port /tmp/ttyV1 --slave-id 1 --timeout 500
  • Verify timeout parameter is accepted
  • Test very short timeouts (10ms, 50ms)

Timeout Error Reporting

  • Use very short timeout to force timeout errors
  • Verify "Timeout" appears in Error column of output table
  • Verify scan completes with FAIL status for timed-out registers
  • Ensure timeout errors don't crash the profiler

Slow Device Scenarios

  • Configure emulator with high processing delays
  • Verify profiler waits for timeout duration
  • Verify timing column reflects actual wait time

Implementation

Add tests to tests/e2e/tests/05-device-profiler.bats:

  • Use --timeout parameter with small values (10-50ms)
  • Verify error output contains "Timeout" or similar
  • May need to adjust emulator timing configuration for realistic slow-device tests

Acceptance Criteria

  • Timeout parameter test passes
  • Timeout errors appear in output
  • Profiler completes scan even with timeouts
  • Timing column shows appropriate values
  • Tests use existing fixtures/helpers

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    error-handlingError handling and exception managementpriority:lowLow priority taskscope:device-profilerIssues related to the device-profiler packagescope:testingIssues related to testing infrastructuretestingTesting improvements and additionstype:testingTesting improvements or additions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions