cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.18k stars 3.82k forks source link

roachtest: split Monitor functionality in two components #118214

Open renatolabs opened 10 months ago

renatolabs commented 10 months ago

Typical uses of the roachtest monitor are as follows:

m := c.NewMonitor()
m.Go(func(context.Context) error {
    // user logic...
})

m.Wait()

This is a summary of the two main functions provided by the monitor:

This API is less than ideal for the following reasons:

Proposal

A proposed way to deal with this is to promote node monitoring to the test runner as a default. Every test should have an active "node monitor" that checks for unexpected node deaths. We could have a single t.ExpectNodeDeath(n1) to indicate that this test expects n1 to die, and that can happen only once. What's currently the Monitor will be deprecated in tests in favour of a simple goroutine runner with builtin panic handling.

Jira issue: CRDB-35614

blathers-crl[bot] commented 10 months ago

cc @cockroachdb/test-eng