diff --git a/pkg/cmd/roachtest/cluster.go b/pkg/cmd/roachtest/cluster.go index 30c53823166e..542023702376 100644 --- a/pkg/cmd/roachtest/cluster.go +++ b/pkg/cmd/roachtest/cluster.go @@ -2359,6 +2359,12 @@ func (c *clusterImpl) MakeNodes(opts ...option.Option) string { if s, ok := o.(nodeSelector); ok { r = s.Merge(r) } + if _, ok := o.(*option.NoNodes); ok { + return "" + } + if _, ok := o.(option.NoNodes); ok { + return "" + } } return c.name + r.String() } diff --git a/pkg/cmd/roachtest/monitor.go b/pkg/cmd/roachtest/monitor.go index 758205337714..8d3095c4d0dd 100644 --- a/pkg/cmd/roachtest/monitor.go +++ b/pkg/cmd/roachtest/monitor.go @@ -180,6 +180,10 @@ func (m *monitorImpl) wait() error { wg.Done() }() + if m.nodes == "" { + <-m.ctx.Done() + return + } messagesChannel, err := roachprod.Monitor(m.ctx, m.l, m.nodes, install.MonitorOpts{}) if err != nil { setErr(errors.Wrap(err, "monitor command failure")) diff --git a/pkg/cmd/roachtest/option/node_list_option.go b/pkg/cmd/roachtest/option/node_list_option.go index 1e5a59775c40..6881ffffb802 100644 --- a/pkg/cmd/roachtest/option/node_list_option.go +++ b/pkg/cmd/roachtest/option/node_list_option.go @@ -113,3 +113,9 @@ func (n NodeListOption) String() string { } return buf.String() } + +// NoNodes is an option that explicitly deselects all nodes. +type NoNodes struct{} + +// Option implements option.Option. +func (n NoNodes) Option() {}