Skip to content

Commit f9bade8

Browse files
committed
fixup: respond to review feedback #3
1 parent 8c9571c commit f9bade8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/fixture/testnet/local/node.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,11 @@ func (n *LocalNode) IsHealthy(ctx context.Context) (bool, error) {
322322
return false, fmt.Errorf("failed to query node health: %w", err)
323323
}
324324

325+
// WaitForHealthy blocks until IsHealthy returns true or an error (including context timeout) is observed.
325326
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+
}
326330
ticker := time.NewTicker(DefaultNodeTickerInterval)
327331
defer ticker.Stop()
328332

0 commit comments

Comments
 (0)