-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#23652] YSQL: Fix TestPgRegressAnalyze.java timeout / database drop …
…failure on TSAN build Summary: * Split off yb_reset_analyze tests from TestPgRegressAnalyze.java and create the .java file of its own. * Speed up some of the operations in `yb_reset_analyze_statistics.sql`: * Add `NONCONCURRENTLY` to `CREATE INDEX` statements for speed up. * Explicitly set `yb_enable_optimizer_statistics` and `yb_enable_base_scans_cost_model` to ON via `ALTER DATABASE` to make the optimizer's behavior more predictable with the tables analyzed and unanalyzed. * Rewrite the stats comparison query to be executed more efficiently by using FULL JOIN instead of EXCEPT/UNION ALL set operations. * Use the `WITH (FORCE)` option for dropping the `reset_analyze_test` database to avoid intermittent "database xxx is being accessed by other users" error right after reconnected as another user or hitting the timeout during the `DROP DATABASE` command. Jira: DB-12563 Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressResetAnalyze' ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressAnalyze' Jenkins: build type: tsan Jenkins: test regex: .*testPgRegress.*Analyze.* Reviewers: tnayak Reviewed By: tnayak Subscribers: smishra, yql, svc_phabricator Differential Revision: https://phorge.dev.yugabyte.com/D37582
- Loading branch information
Showing
5 changed files
with
123 additions
and
57 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
java/yb-pgsql/src/test/java/org/yb/pgsql/TestPgRegressResetAnalyze.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
// Copyright (c) YugaByte, Inc. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except | ||
// in compliance with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software distributed under the License | ||
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express | ||
// or implied. See the License for the specific language governing permissions and limitations | ||
// under the License. | ||
// | ||
package org.yb.pgsql; | ||
|
||
import java.util.Map; | ||
|
||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.yb.minicluster.MiniYBClusterBuilder; | ||
import org.yb.YBTestRunner; | ||
|
||
import com.google.common.collect.ImmutableMap; | ||
|
||
/** | ||
* Runs the pg_regress test suite on YB code. | ||
*/ | ||
@RunWith(value=YBTestRunner.class) | ||
public class TestPgRegressResetAnalyze extends BasePgRegressTest { | ||
|
||
private Map<String, String> commonTserverFlags = ImmutableMap.of( | ||
"ysql_beta_features", "1"); | ||
|
||
@Override | ||
protected void customizeMiniClusterBuilder(MiniYBClusterBuilder builder) { | ||
super.customizeMiniClusterBuilder(builder); | ||
builder.addCommonTServerFlags(commonTserverFlags); | ||
} | ||
|
||
@Test | ||
public void testPgRegressResetAnalyze() throws Exception { | ||
runPgRegressTest("yb_reset_analyze_schedule"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# src/test/regress/yb_reset_analyze_schedule | ||
# | ||
#################################################################################################### | ||
# This testsuite contains testcases pertinent to yb_reset_analyze function. | ||
#################################################################################################### | ||
test: yb_reset_analyze |