Skip to content

Commit 6d90a52

Browse files
craig[bot]cockroach-teamcityraildhartunian
committed
150712: master: Update pkg/testutils/release/cockroach_releases.yaml r=rail a=cockroach-teamcity Update pkg/testutils/release/cockroach_releases.yaml with recent values. Epic: None Release note: None Release justification: test-only updates 151576: server: TestCheckRestartSafe omits descriptor leak check r=fqazi a=dhartunian These tests were flaking due to the descriptor leak detection during draining that was implemented for tests. This check is unnecessary for the endpoints that are being tested here. A separate method was added to the test server to omit this assertion called `DrainClientsWithoutLeakCheck` this calls a new internal helper on the `drainServer` that omits the check. Resolves: #151377 Resolves: #151455 Epic: None Release note: None Co-authored-by: CRL Release bot <[email protected]> Co-authored-by: Rail Aliiev <[email protected]> Co-authored-by: David Hartunian <[email protected]>
3 parents ada36ca + f50f6b7 + 3134261 commit 6d90a52

File tree

10 files changed

+43
-17
lines changed

10 files changed

+43
-17
lines changed
3.84 MB
Binary file not shown.
3.75 MB
Binary file not shown.
3.59 MB
Binary file not shown.
2.49 MB
Binary file not shown.

pkg/server/api_v2_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ func drain(ctx context.Context, ts1 serverutils.TestServerInterface, t *testing.
547547
timeoutCtx, cancel := context.WithTimeout(ctx, testutils.SucceedsSoonDuration())
548548
defer cancel()
549549

550-
err := ts1.DrainClients(ctx)
550+
err := ts1.DrainClientsWithoutLeakCheck(ctx)
551551
require.NoError(t, err)
552552

553553
for timeoutCtx.Err() == nil {

pkg/server/drain.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,12 @@ func (s *drainServer) isDraining() bool {
398398
// drainClients starts draining the SQL layer.
399399
func (s *drainServer) drainClients(
400400
ctx context.Context, reporter func(int, redact.SafeString),
401+
) error {
402+
return s.drainClientsInternal(ctx, reporter, true /* assertOnLeakedDescriptor */)
403+
}
404+
405+
func (s *drainServer) drainClientsInternal(
406+
ctx context.Context, reporter func(int, redact.SafeString), assertOnLeakedDescriptor bool,
401407
) error {
402408
// Setup a cancelable context so that the logOpenConns goroutine exits when
403409
// this function returns.
@@ -486,7 +492,7 @@ func (s *drainServer) drainClients(
486492
// Drain all SQL table leases. This must be done after the pgServer has
487493
// given sessions a chance to finish ongoing work and after the background
488494
// tasks that may issue SQL statements have shut down.
489-
s.sqlServer.leaseMgr.SetDraining(ctx, true /* drain */, reporter, true /*assertOnLeakedDescriptor*/)
495+
s.sqlServer.leaseMgr.SetDraining(ctx, true /* drain */, reporter, assertOnLeakedDescriptor)
490496

491497
session, err := s.sqlServer.sqlLivenessProvider.Release(ctx)
492498
if err != nil {

pkg/server/testserver.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1242,6 +1242,11 @@ func (t *testTenant) DrainClients(ctx context.Context) error {
12421242
return t.drain.drainClients(ctx, nil /* reporter */)
12431243
}
12441244

1245+
// DrainClients exports the drainClientsInternal() method for use by tests.
1246+
func (t *testTenant) DrainClientsWithoutLeakCheck(ctx context.Context) error {
1247+
return t.drain.drainClientsInternal(ctx, nil /* reporter */, false)
1248+
}
1249+
12451250
// Readiness is part of the serverutils.ApplicationLayerInterface.
12461251
func (t *testTenant) Readiness(ctx context.Context) error {
12471252
return t.t.admin.checkReadinessForHealthCheck(ctx)
@@ -1943,6 +1948,13 @@ func (ts *testServer) DrainClients(ctx context.Context) error {
19431948
return ts.drain.drainClients(ctx, nil /* reporter */)
19441949
}
19451950

1951+
// DrainClientsWithoutLeakCheck exports the drainClients() method for use by tests
1952+
// with descriptor leak checking disabled. This is useful for tests that focus on
1953+
// restart safety logic rather than lease management correctness.
1954+
func (ts *testServer) DrainClientsWithoutLeakCheck(ctx context.Context) error {
1955+
return ts.drain.drainClientsInternal(ctx, nil, false /* assertOnLeakedDescriptor */)
1956+
}
1957+
19461958
// Readiness is part of the serverutils.ApplicationLayerInterface.
19471959
func (ts *testServer) Readiness(ctx context.Context) error {
19481960
return ts.admin.checkReadinessForHealthCheck(ctx)

pkg/sql/logictest/REPOSITORIES.bzl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,17 @@ CONFIG_DARWIN_AMD64 = "darwin-10.9-amd64"
77
CONFIG_DARWIN_ARM64 = "darwin-11.0-arm64"
88

99
_CONFIGS = [
10-
("25.1.8", [
11-
(CONFIG_DARWIN_AMD64, "d57efe62719e4386fa700608ff516166e3e6a99ba77aa55451c9d2b7e52dec5e"),
12-
(CONFIG_DARWIN_ARM64, "de8b4752d1adb6d84874dc9a18b257bf996d94b46bd6507c01a5e5dd79f11c8c"),
13-
(CONFIG_LINUX_AMD64, "4dcd1d0dbbee3e659bddde2139f76f1ffac1cbccf6177a6d9d53fd158534e968"),
14-
(CONFIG_LINUX_ARM64, "642a841efd1575dca6bd447d41332fac5700d44881cd20bf4d54f4e9952b28b7"),
10+
("25.2.4", [
11+
(CONFIG_DARWIN_AMD64, "23e2f7e68a38fcc8186f00e021e3e851823a32dad2d31663f594c2b904c71a58"),
12+
(CONFIG_DARWIN_ARM64, "86c28ca0400660205db20ebcc81d3ea296f7efae5e6bb13c2bf31bc04651fad6"),
13+
(CONFIG_LINUX_AMD64, "7b433d00bb57d9947dc9931058b16f44ff31dd2a25ed625233c3bf62e4413b58"),
14+
(CONFIG_LINUX_ARM64, "f808519d147cb0f7772569d981c7f6aa47b82cb06c35e4eb1eb2aaad87024813"),
1515
]),
16-
("25.2.2", [
17-
(CONFIG_DARWIN_AMD64, "a339440dfa4012756f5c7e1b558b5c6b60deac9f6b2237a136b7b13f04c25696"),
18-
(CONFIG_DARWIN_ARM64, "ec20ce6fe930494b1fe6bd10717277d878a8991752a202907faeca7bc5fad924"),
19-
(CONFIG_LINUX_AMD64, "b0f695dfa6002834fbeeed0be2f5bf0d2b457b0a245724c3104078ed04549644"),
20-
(CONFIG_LINUX_ARM64, "c631bdccd47d2c0f92fc288aab216bb3451cc3b1276aab741b912a9fd61f144f"),
16+
("25.3.0-rc.1", [
17+
(CONFIG_DARWIN_AMD64, "3db248ebd5882f3f917048e58b7ee805b34accfa802335ab52f13ff1a8fbcf86"),
18+
(CONFIG_DARWIN_ARM64, "637a931ccbea8d3a4cd4832775a8689f1dd91529c29b17ae3dfdfbe9c50d3953"),
19+
(CONFIG_LINUX_AMD64, "80d6aa37ce377d7fe096dd9a8ce2f361e2f1e40940989a6ac15b411fee0cf048"),
20+
(CONFIG_LINUX_ARM64, "6f400ec9c8b4770be91f23b4b1796bd2dd959352536b4012c4edef7b50e03ae8"),
2121
]),
2222
]
2323

pkg/testutils/release/cockroach_releases.yaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,24 @@
2222
latest: 23.2.27
2323
predecessor: "23.1"
2424
"24.1":
25-
latest: 24.1.20
25+
latest: 24.1.22
2626
predecessor: "23.2"
2727
"24.2":
2828
latest: 24.2.10
2929
withdrawn:
3030
- 24.2.1
3131
predecessor: "24.1"
3232
"24.3":
33-
latest: 24.3.15
33+
latest: 24.3.17
3434
predecessor: "24.2"
3535
"25.1":
36-
latest: 25.1.8
36+
latest: 25.1.10
3737
predecessor: "24.3"
3838
"25.2":
39-
latest: 25.2.2
39+
latest: 25.2.4
4040
predecessor: "25.1"
41-
"25.4":
41+
"25.3":
42+
latest: 25.3.0-rc.1
4243
predecessor: "25.2"
44+
"25.4":
45+
predecessor: "25.3"

pkg/testutils/serverutils/api.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,11 @@ type ApplicationLayerInterface interface {
405405
// DrainClients shuts down client connections.
406406
DrainClients(ctx context.Context) error
407407

408+
// DrainClientsWithoutLeakCheck shuts down client connections but will
409+
// skip the assertion that checks for descriptor leaks. This is meant
410+
// to enable specific tests that may drain unsafely.
411+
DrainClientsWithoutLeakCheck(ctx context.Context) error
412+
408413
// SystemConfigProvider provides access to the system config.
409414
SystemConfigProvider() config.SystemConfigProvider
410415

0 commit comments

Comments
 (0)