SQL: fixed falky failures in AbstractSchemaSelfTest. This closes
@@ -37,6 +37,7 @@ import org.apache.ignite.cache.query.SqlFieldsQuery;
import org.apache.ignite.cache.query.annotations.QuerySqlField;
import org.apache.ignite.configuration.CacheConfiguration;
import org.apache.ignite.internal.IgniteEx;
+import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.processors.odbc.ClientListenerProcessor;
import org.apache.ignite.internal.processors.port.GridPortRecord;
import org.apache.ignite.internal.processors.query.GridQueryProcessor;
@@ -48,6 +49,7 @@ import org.apache.ignite.internal.util.GridStringBuilder;
import org.apache.ignite.internal.util.typedef.F;
import org.apache.ignite.internal.util.typedef.T2;
import org.apache.ignite.internal.util.typedef.internal.SB;
+import org.apache.ignite.internal.util.typedef.internal.U;
import org.apache.ignite.lang.IgniteBiTuple;
import org.apache.ignite.testframework.junits.common.GridCommonAbstractTest;
import org.jetbrains.annotations.Nullable;
@@ -172,6 +174,8 @@ public abstract class AbstractSchemaSelfTest extends GridCommonAbstractTest {
*/
static void assertIndex(Ignite node, String cacheName, String tblName,
String idxName, int inlineSize, IgniteBiTuple<String, Boolean>... fields) {
+ awaitCompletion();
+
node.cache(cacheName);
IgniteEx node0 = (IgniteEx)node;
@@ -267,6 +271,8 @@ public abstract class AbstractSchemaSelfTest extends GridCommonAbstractTest {
* @param idxName Index name.
*/
static void assertNoIndex(Ignite node, String cacheName, String tblName, String idxName) {
+ awaitCompletion();
+
node.cache(cacheName);
try {
@@ -284,6 +290,18 @@ public abstract class AbstractSchemaSelfTest extends GridCommonAbstractTest {
}
}
+ /**
+ * Await completion (hopefully) of pending operations.
+ */
+ private static void awaitCompletion() {
+ try {
+ U.sleep(100);
+ }
+ catch (IgniteInterruptedCheckedException e) {
+ fail();
+ }
+ }
+
/**
* Get table name for class.
*
