Skip to content

Handle JoinSet task errors in test utility functions #6505

@coderabbitai

Description

@coderabbitai

Problem

In src/tool/subcommands/api_cmd/test_snapshot.rs and src/tool/subcommands/api_cmd/generate_test_snapshot.rs, background tasks that consume JoinSet results currently drop them silently using the pattern:

tokio::spawn(async move { while services.join_next().await.is_some() {} });

This ignores Result variants for panics and cancellations returned by join_next(). The standard pattern used elsewhere in the codebase (e.g., chain_sync/, daemon/mod.rs) is to check results with while let Some(res) and handle errors appropriately.

Context

A similar issue was fixed in src/tool/offline_server/server.rs in PR #6493, but attempts to fix it in the test utility files caused codecov CI to constantly timeout, requiring the changes to be reverted.

Files to Fix

  • src/tool/subcommands/api_cmd/test_snapshot.rs
  • src/tool/subcommands/api_cmd/generate_test_snapshot.rs

Related

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Ready

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions