We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8c9571c commit f9bade8Copy full SHA for f9bade8
tests/fixture/testnet/local/node.go
@@ -322,7 +322,11 @@ func (n *LocalNode) IsHealthy(ctx context.Context) (bool, error) {
322
return false, fmt.Errorf("failed to query node health: %w", err)
323
}
324
325
+// WaitForHealthy blocks until IsHealthy returns true or an error (including context timeout) is observed.
326
func (n *LocalNode) WaitForHealthy(ctx context.Context) error {
327
+ if _, ok := ctx.Deadline(); !ok {
328
+ return fmt.Errorf("unable to wait for health for node %q with a context without a deadline", n.NodeID)
329
+ }
330
ticker := time.NewTicker(DefaultNodeTickerInterval)
331
defer ticker.Stop()
332
0 commit comments