{"record":{"id":"b9307e62d26841ad","repo":"unionlabs/union","slug":"timed-out-after","errorCode":null,"errorMessage":"timed out after {:?}","messagePattern":"timed out after (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"tools/union-test/src/cosmos.rs","lineNumber":256,"sourceCode":"                                if let Some(found) = filter_fn(&ibc_evt) {\n                                    events.push(found);\n                                }\n                            }\n                        }\n\n                        if seen >= resp.total_count as usize {\n                            break;\n                        }\n                        page = page.checked_add(1).unwrap();\n                    }\n\n                    height += 1;\n                }\n                tokio::time::sleep(Duration::from_secs(5)).await;\n            }\n        })\n        .await\n        .map_err(|_| anyhow::anyhow!(\"timed out after {:?}\", max_wait))?\n    }\n\n    pub async fn wait_for_create_client_id(\n        &self,\n        max_wait: Duration,\n    ) -> anyhow::Result<helpers::CreateClientConfirm> {\n        Ok(self\n            .wait_for_event(\n                |evt| {\n                    if let ModuleEvent::WasmCreateClient { client_id, .. } = evt {\n                        Some(helpers::CreateClientConfirm {\n                            client_id: client_id.raw(),\n                        })\n                    } else {\n                        None\n                    }\n                },\n                max_wait,","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/unionlabs/union/blob/031785bb6dc6b957c624e62bc64c184409c97d7b/tools/union-test/src/cosmos.rs#L238-L274","documentation":"`CosmosClient::wait_for_event` wraps a poll loop (tx_search per block height, 5s sleep between rounds) in `tokio::time::timeout(max_wait, ...)`. This error means the deadline elapsed before `expected_event_count` matching IBC module events were found — the event never showed up in the scanned window, not that an RPC request failed.","triggerScenarios":"Waiting for create-client / packet-recv / delegate events that are never emitted: chain or relayer halted; the event fired more than ~10 blocks before the wait started (the scan begins at `latest_block_height - 10` so older events are missed); the filter_fn never matches the emitted ModuleEvent variant; expected_event_count is larger than the number of events actually produced.","commonSituations":"Devnet validators stuck or not producing blocks; test waits long after submitting the tx; RPC node whose /status lags; serde schema drift between union-test's ModuleEvent and the chain's event attributes so matching events are silently skipped.","solutions":["Increase the `max_wait` Duration passed by the caller","Start the wait before (or immediately after) submitting the transaction, not >10 blocks later","Confirm the chain is progressing (latest_block_height advances between poll rounds)","Dump raw tx_search events for the tx's height and compare event type/attributes against the filter","If events deserialize-fail silently, align the union-test version with the chain's event schema"],"exampleFix":"// before\nlet evt = client.wait_for_create_client_id(Duration::from_secs(60)).await?; \n// after\nlet evt = client.wait_for_create_client_id(Duration::from_secs(600)).await?;","handlingStrategy":"retry","validationCode":"// pre-flight: confirm the chain is making progress before waiting\nlet s1 = client.rpc.status().await?.sync_info.latest_block_height;\ntokio::time::sleep(Duration::from_secs(5)).await;\nlet s2 = client.rpc.status().await?.sync_info.latest_block_height;\nanyhow::ensure!(s2 > s1, \"chain not producing blocks; wait_for_event would time out\");","typeGuard":null,"tryCatchPattern":"match client.wait_for_event(filter, max_wait, n).await {\n    Ok(evts) => { /* ... */ }\n    Err(e) if e.to_string().contains(\"timed out after\") => {\n        // re-check chain liveness and the tx was actually submitted, then retry with a longer window\n        tokio::time::sleep(Duration::from_secs(10)).await;\n        client.wait_for_event(filter, max_wait * 2, n).await?\n    }\n    Err(e) => return Err(e),\n}","preventionTips":["Start event waits before or immediately after submitting the transaction (events older than ~10 blocks are missed)","Size max_wait to chain block time plus expected processing, with margin for slow devnets","Log the tx height you expect the event at so timeouts are diagnosable"],"tags":["rust","cosmos","timeout","ibc","polling"],"backgroundTag":null,"analyzedSha":"031785bb6dc6b957c624e62bc64c184409c97d7b","analyzedAt":"2026-08-16T06:24:09.996Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}