Skip to content

Commit

Permalink
server: fix StartedDefaultTestTenant in an error case
Browse files Browse the repository at this point in the history
Previously, if `TestServer.Start` returned an error while the default
test tenant wasn't disabled, we'd incorrectly consider that we had
started the default test tenant. This, then, could lead to some problems
(e.g. trying to access non-existing tenant which could lead to a crash).
This is fixed by checking whether we have test tenants.

Release note: None
  • Loading branch information
yuzefovich committed Jul 18, 2023
1 parent 609230c commit e0b83fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/server/testserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -1714,7 +1714,7 @@ func (ts *TestServer) ExecutorConfig() interface{} {

// StartedDefaultTestTenant is part of the serverutils.TestServerInterface.
func (ts *TestServer) StartedDefaultTestTenant() bool {
return !ts.cfg.DisableDefaultTestTenant
return len(ts.testTenants) > 0
}

// TenantOrServer is part of the serverutils.TestServerInterface.
Expand Down

0 comments on commit e0b83fd

Please sign in to comment.