(t *testing.T)
| 4432 | } |
| 4433 | |
| 4434 | func TestUpdateCalculatedStatsPanic(t *testing.T) { |
| 4435 | |
| 4436 | var dbc *DatabaseContext |
| 4437 | |
| 4438 | defer func() { |
| 4439 | r := recover() |
| 4440 | if r != nil { |
| 4441 | t.Errorf("UpdateCalculatedStats panic recovered, stack trace: %s", debug.Stack()) |
| 4442 | } |
| 4443 | }() |
| 4444 | |
| 4445 | // nil DatabaseContext check |
| 4446 | ctx := base.TestCtx(t) |
| 4447 | dbc.UpdateCalculatedStats(ctx) |
| 4448 | |
| 4449 | // non-nil DatabaseContext, nil stats |
| 4450 | dbc = &DatabaseContext{} |
| 4451 | dbc.UpdateCalculatedStats(ctx) |
| 4452 | |
| 4453 | // non-nil DatabaseContext and stats, nil channel cache |
| 4454 | dbStats, statsError := initDatabaseStats(ctx, "db", false, DatabaseContextOptions{}) |
| 4455 | require.NoError(t, statsError) |
| 4456 | dbc.DbStats = dbStats |
| 4457 | dbc.UpdateCalculatedStats(ctx) |
| 4458 | } |
| 4459 | |
| 4460 | func Test_waitForBackgroundManagersToStop(t *testing.T) { |
| 4461 | // use testing/synctest to have fake time once go 1.25 is available. In the meantime, windows and -race are |
nothing calls this directly
no test coverage detected