Skip to content

Improved SDK Test Handling for Network Connectivity Issues#279

Open
dxbr wants to merge 2 commits intorecallnet:mainfrom
dxbr:main
Open

Improved SDK Test Handling for Network Connectivity Issues#279
dxbr wants to merge 2 commits intorecallnet:mainfrom
dxbr:main

Conversation

@dxbr
Copy link

@dxbr dxbr commented Sep 22, 2025

SDK Test Improvement: Network Error Handling

Overview

This update addresses a critical issue in the SDK test suite, specifically with the can_deposit_into_subnet test. Previously, the test would panic and fail if there was no local subnet available, causing unnecessary errors during the testing process. This update improves the test's robustness by gracefully handling network connectivity errors and ensuring that the test skips when the network is unavailable, instead of causing a panic.

Key Changes

  • Reworked Test Helper: Refactored the test helper to return anyhow::Result instead of unwrapping, enabling better error handling.
  • Connectivity Error Detection: Introduced targeted connection checks using reqwest, allowing the test to detect network issues.
  • Graceful Test Skipping: The test now skips gracefully when the network is unavailable, avoiding panics on offline machines.
  • New Dependency: Added reqwest as a shared-workspace dependency for testing the connectivity checks.
  • Cargo.lock Update: Refreshed Cargo.lock to support the new error handling logic.

Testing & Results

  • Conditional Skipping: The integration test now conditionally skips when network connectivity is unavailable, ensuring no false failures.
  • Full Test Suite: The complete workspace test suite ran successfully using cargo test, confirming that all tests passed without introducing new issues.

Summary

This fix ensures that SDK tests are more resilient to network failures, preventing unnecessary panics and improving the overall test experience for developers. By adding better error handling and skipping tests when appropriate, this update provides a more stable and predictable testing environment.


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.

1 participant