Skip to content

Commit 498960b

Browse files
authored
Merge pull request #153468 from alyshanjahani-crl/backportrelease-25.2-153366
release-25.2: serverccl, application_api: Fix some tests relying on statement_statistics
2 parents ffa6e5d + a6a7e28 commit 498960b

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

pkg/ccl/serverccl/statusccl/tenant_status_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,6 @@ func TestTenantCannotSeeNonTenantStats(t *testing.T) {
501501

502502
var actualStatements []string
503503
for _, respStatement := range actual.Statements {
504-
if respStatement.Stats.FailureCount > 0 {
505-
// We ignore failed statements here as the INSERT statement can fail and
506-
// be automatically retried, confusing the test success check.
507-
continue
508-
}
509504
if strings.HasPrefix(respStatement.Key.KeyData.App, catconstants.InternalAppNamePrefix) {
510505
// We ignore internal queries, these are not relevant for the
511506
// validity of this test.

pkg/server/application_api/sql_stats_test.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -446,11 +446,6 @@ func TestStatusAPIStatements(t *testing.T) {
446446
// See if the statements returned are what we executed.
447447
var statementsInResponse []string
448448
for _, respStatement := range resp.Statements {
449-
if respStatement.Stats.FailureCount > 0 {
450-
// We ignore failed statements here as the INSERT statement can fail and
451-
// be automatically retried, confusing the test success check.
452-
continue
453-
}
454449
if strings.HasPrefix(respStatement.Key.KeyData.App, catconstants.InternalAppNamePrefix) {
455450
// We ignore internal queries, these are not relevant for the
456451
// validity of this test.
@@ -787,14 +782,7 @@ func TestStatusAPICombinedStatementsWithFullScans(t *testing.T) {
787782
// statement statistics received from the server response.
788783
actualResponseStatsMap := make(map[string]serverpb.StatementsResponse_CollectedStatementStatistics)
789784
for _, respStatement := range resp.Statements {
790-
// Skip failed statements: The test app may encounter transient 40001
791-
// errors that are automatically retried. Thus, we only consider
792-
// statements that were that were successfully executed by the test app
793-
// to avoid counting such failures. If a statement that we expect to be
794-
// successful is not found in the response, the test will fail later.
795-
if respStatement.Key.KeyData.App == testAppName && respStatement.Stats.FailureCount == 0 {
796-
actualResponseStatsMap[respStatement.Key.KeyData.Query] = respStatement
797-
}
785+
actualResponseStatsMap[respStatement.Key.KeyData.Query] = respStatement
798786
}
799787

800788
for respQuery, expectedData := range expectedStatementStatsMap {
@@ -904,11 +892,6 @@ func TestStatusAPICombinedStatements(t *testing.T) {
904892
var statementsInResponse []string
905893
expectedTxnFingerprints := map[appstatspb.TransactionFingerprintID]struct{}{}
906894
for _, respStatement := range resp.Statements {
907-
if respStatement.Stats.FailureCount > 0 {
908-
// We ignore failed statements here as the INSERT statement can fail and
909-
// be automatically retried, confusing the test success check.
910-
continue
911-
}
912895
if strings.HasPrefix(respStatement.Key.KeyData.App, catconstants.InternalAppNamePrefix) {
913896
// CombinedStatementStats should filter out internal queries.
914897
t.Fatalf("unexpected internal query: %s", respStatement.Key.KeyData.Query)

0 commit comments

Comments
 (0)