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
Problem
In
src/tool/subcommands/api_cmd/test_snapshot.rsandsrc/tool/subcommands/api_cmd/generate_test_snapshot.rs, background tasks that consume JoinSet results currently drop them silently using the pattern:This ignores
Resultvariants for panics and cancellations returned byjoin_next(). The standard pattern used elsewhere in the codebase (e.g.,chain_sync/,daemon/mod.rs) is to check results withwhile let Some(res)and handle errors appropriately.Context
A similar issue was fixed in
src/tool/offline_server/server.rsin 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.rssrc/tool/subcommands/api_cmd/generate_test_snapshot.rsRelated
start_rpc#6493start_rpc#6493 (comment)