Skip to content

Add IMDS helper failure-path tests #1126

@VaibhavUpreti

Description

@VaibhavUpreti

Why this matters

EC2 metadata lookup should fail quietly. This is a good isolated test task with no product behavior risk.

Files to touch

  • tests/app/remote/test_server.py

Exactly what to do

  1. Add tests for _imds_token() when urlopen() raises URLError.
  2. Add tests for _imds_get() when urlopen() raises TimeoutError or OSError.
  3. Assert both helpers return None.
  4. Keep the tests local and fully mocked.

Done when

  • IMDS helpers have explicit coverage for the failure paths listed in the code
  • No network is used in tests

Verify

python -m pytest tests/app/remote/test_server.py -q

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueGood for newcomershelp wantedExtra attention is neededremoteRemote runtime and hosted ops work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions