This is an automated email from the ASF dual-hosted git repository.
panjuan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 90f7a207116 Fix GeneralRALE2EIT test error (#24545)
90f7a207116 is described below
commit 90f7a207116dcfd6cba828476dcef5916e0fddb5
Author: jiangML <[email protected]>
AuthorDate: Mon Mar 13 15:44:04 2023 +0800
Fix GeneralRALE2EIT test error (#24545)
* fix suite test error
* fix fill data error in BaseDQLE2EIT
* fix fill data error in BaseDQLE2EIT
* fix fill data error in BaseDQLE2EIT
* fix SHOW DIST VARIABLE error
---
.../org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java | 2 +-
.../org/apache/shardingsphere/test/e2e/engine/ral/BaseRALE2EIT.java | 6 ++++--
.../apache/shardingsphere/test/e2e/engine/ral/GeneralRALE2EIT.java | 2 +-
test/e2e/suite/src/test/resources/cases/ral/ral-integration-set.xml | 4 ++--
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java
index 5ab474f3cbc..5c1d1e9a1b0 100644
---
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java
+++
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/dql/BaseDQLE2EIT.java
@@ -76,7 +76,7 @@ public abstract class BaseDQLE2EIT extends SingleE2EIT {
private void fillDataOnlyOnce() throws SQLException, ParseException,
IOException, JAXBException {
if (!FILLED_SUITES.contains(getItKey())) {
synchronized (FILLED_SUITES) {
- if (!FILLED_SUITES.contains(getScenario())) {
+ if (!FILLED_SUITES.contains(getItKey())) {
new DataSetEnvironmentManager(new
ScenarioDataPath(getScenario()).getDataSetFile(Type.ACTUAL),
getActualDataSourceMap()).fillData();
new DataSetEnvironmentManager(new
ScenarioDataPath(getScenario()).getDataSetFile(Type.EXPECTED),
getExpectedDataSourceMap()).fillData();
FILLED_SUITES.add(getItKey());
diff --git
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/ral/BaseRALE2EIT.java
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/ral/BaseRALE2EIT.java
index eb3add82b6f..41a0d9da909 100644
---
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/ral/BaseRALE2EIT.java
+++
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/ral/BaseRALE2EIT.java
@@ -74,6 +74,7 @@ public abstract class BaseRALE2EIT extends SingleE2EIT {
preparedStatement.executeUpdate();
}
}
+ sleep(1000);
}
private void executeDestroySQLs(final Connection connection) throws
SQLException {
@@ -85,11 +86,12 @@ public abstract class BaseRALE2EIT extends SingleE2EIT {
preparedStatement.executeUpdate();
}
}
+ sleep(1000);
}
- protected void sleep() {
+ protected void sleep(final long timeout) {
try {
- TimeUnit.SECONDS.sleep(2);
+ TimeUnit.MILLISECONDS.sleep(timeout);
} catch (final InterruptedException ignored) {
}
}
diff --git
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/ral/GeneralRALE2EIT.java
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/ral/GeneralRALE2EIT.java
index 520cccc6b36..87450addd0d 100644
---
a/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/ral/GeneralRALE2EIT.java
+++
b/test/e2e/suite/src/test/java/org/apache/shardingsphere/test/e2e/engine/ral/GeneralRALE2EIT.java
@@ -59,7 +59,7 @@ public final class GeneralRALE2EIT extends BaseRALE2EIT {
assertResultSet(statement, getSQL());
} else {
statement.execute(getSQL());
- sleep();
+ sleep(2000);
assertResultSet(statement,
getAssertion().getAssertionSQL().getSql());
}
}
diff --git
a/test/e2e/suite/src/test/resources/cases/ral/ral-integration-set.xml
b/test/e2e/suite/src/test/resources/cases/ral/ral-integration-set.xml
index ba684c4dd09..daceedaab81 100644
--- a/test/e2e/suite/src/test/resources/cases/ral/ral-integration-set.xml
+++ b/test/e2e/suite/src/test/resources/cases/ral/ral-integration-set.xml
@@ -17,11 +17,11 @@
-->
<integration-test-cases>
- <!--<test-case sql="SET DIST VARIABLE sql_show = true;">
+ <test-case sql="SET DIST VARIABLE sql_show = true;">
<assertion
expected-data-file="set_dist_variable_sql_show_equal_true.xml">
<initial-sql sql="SET DIST VARIABLE sql_show = true;" />
<assertion-sql sql="SHOW DIST VARIABLE WHERE name = sql_show;" />
<destroy-sql sql="SET DIST VARIABLE sql_show = false;" />
</assertion>
- </test-case> -->
+ </test-case>
</integration-test-cases>