You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by av...@apache.org on 2020/10/06 14:07:59 UTC

[ignite] 01/01: Pme test fix

This is an automated email from the ASF dual-hosted git repository.

av pushed a commit to branch ignite-ducktape-pme-test-fix
in repository https://gitbox.apache.org/repos/asf/ignite.git

commit 4cd60fb7e5fb8e7d7af59a0208af6822ed64977b
Author: Anton Vinogradov <av...@apache.org>
AuthorDate: Tue Oct 6 17:07:10 2020 +0300

    Pme test fix
---
 .../CellularPreparedTxStreamer.java                 |  2 +-
 .../cellular_affinity_test/CellularTxStreamer.java  |  4 ++--
 .../LongTxStreamerApplication.java                  | 21 +++++++++++++++++----
 .../SingleKeyTxStreamerApplication.java             |  2 +-
 .../ignitetest/tests/cellular_affinity_test.py      |  6 +++---
 .../tests/ignitetest/tests/pme_free_switch_test.py  |  2 ++
 6 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/cellular_affinity_test/CellularPreparedTxStreamer.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/cellular_affinity_test/CellularPreparedTxStreamer.java
index 43424eb..9c7a97e 100644
--- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/cellular_affinity_test/CellularPreparedTxStreamer.java
+++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/cellular_affinity_test/CellularPreparedTxStreamer.java
@@ -79,7 +79,7 @@ public class CellularPreparedTxStreamer extends IgniteAwareApplication {
             i--;
         }
 
-        log.info("All transactions prepared (" + cnt + ")");
+        log.info("ALL_TRANSACTIONS_PREPARED (" + cnt + ")");
 
         while (!terminated()) {
             log.info("Waiting for SIGTERM.");
diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/cellular_affinity_test/CellularTxStreamer.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/cellular_affinity_test/CellularTxStreamer.java
index ebfc6f2..6ab1128 100644
--- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/cellular_affinity_test/CellularTxStreamer.java
+++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/cellular_affinity_test/CellularTxStreamer.java
@@ -84,7 +84,7 @@ public class CellularTxStreamer extends IgniteAwareApplication {
 
                 initTime = System.currentTimeMillis();
 
-                log.info("Warmup finished");
+                log.info("WARMUP_FINISHED");
             }
 
             if (record) {
@@ -100,7 +100,7 @@ public class CellularTxStreamer extends IgniteAwareApplication {
             }
 
             if (cnt % 1000 == 0)
-                log.info("Application streamed " + cnt + " transactions [worst_latency=" + Arrays.toString(max) + "]");
+                log.info("APPICATION_STREAMED " + cnt + " transactions [worst_latency=" + Arrays.toString(max) + "]");
         }
 
         recordResult("WORST_LATENCY", Arrays.toString(max));
diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pme_free_switch_test/LongTxStreamerApplication.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pme_free_switch_test/LongTxStreamerApplication.java
index 7e3f146..f83d125 100644
--- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pme_free_switch_test/LongTxStreamerApplication.java
+++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pme_free_switch_test/LongTxStreamerApplication.java
@@ -61,18 +61,23 @@ public class LongTxStreamerApplication extends IgniteAwareApplication {
                     if (tx.state() != TransactionState.ACTIVE) {
                         log.info("Transaction broken. [key=" + finalI + "]");
 
-                        break;
+                        markBroken(new IllegalStateException(
+                            "Illegal Tx state [key=" + finalI + " state=" + tx.state() + "]"));
                     }
 
                     try {
-                        U.sleep(1000);
+                        U.sleep(10);
                     }
                     catch (IgniteInterruptedCheckedException ignored) {
                         // No-op.
                     }
                 }
 
-                log.info("Stopping tx thread [state=" + tx.state() + "]");
+                log.info("Stopping tx thread [key=" + finalI + " state=" + tx.state() + "]");
+
+                tx.rollback();
+
+                log.info("Finishing tx thread [key=" + finalI + " state=" + tx.state() + "]");
 
             }).start();
         }
@@ -91,10 +96,18 @@ public class LongTxStreamerApplication extends IgniteAwareApplication {
                 U.sleep(100); // Keeping node/txs alive.
             }
             catch (IgniteInterruptedCheckedException ignored) {
-                log.info("Waiting interrupted.");
+                log.info("Waiting for interrupted.");
             }
         }
 
+        while (!((IgniteEx)ignite).context().cache().context().tm().activeTransactions().isEmpty())
+            try {
+                U.sleep(100); // Keeping node alive.
+            }
+            catch (IgniteInterruptedCheckedException ignored) {
+                log.info("Waiting for tx rollback.");
+            }
+
         markFinished();
     }
 }
diff --git a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pme_free_switch_test/SingleKeyTxStreamerApplication.java b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pme_free_switch_test/SingleKeyTxStreamerApplication.java
index 14b53a9..5f1fa99 100644
--- a/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pme_free_switch_test/SingleKeyTxStreamerApplication.java
+++ b/modules/ducktests/src/main/java/org/apache/ignite/internal/ducktest/tests/pme_free_switch_test/SingleKeyTxStreamerApplication.java
@@ -66,7 +66,7 @@ public class SingleKeyTxStreamerApplication extends IgniteAwareApplication {
             }
 
             if (cnt % 1000 == 0)
-                log.info("Streamed " + cnt + " transactions [max=" + max + "]");
+                log.info("APPICATION_STREAMED " + cnt + " transactions [max=" + max + "]");
         }
 
         recordResult("WORST_LATENCY", max);
diff --git a/modules/ducktests/tests/ignitetest/tests/cellular_affinity_test.py b/modules/ducktests/tests/ignitetest/tests/cellular_affinity_test.py
index 5d40f17..18fb9f7 100644
--- a/modules/ducktests/tests/ignitetest/tests/cellular_affinity_test.py
+++ b/modules/ducktests/tests/ignitetest/tests/cellular_affinity_test.py
@@ -128,10 +128,10 @@ class CellularAffinity(IgniteTest):
         ControlUtility(cell1, self.test_context).activate()
 
         for loader in loaders:
-            loader.await_event("All transactions prepared", 180, from_the_beginning=True)
+            loader.await_event("ALL_TRANSACTIONS_PREPARED", 180, from_the_beginning=True)
 
         for streamer in streamers:
-            streamer.await_event("Warmup finished", 180, from_the_beginning=True)
+            streamer.await_event("WARMUP_FINISHED", 180, from_the_beginning=True)
 
         failed_loader.stop_async()  # node left with prepared txs.
 
@@ -142,7 +142,7 @@ class CellularAffinity(IgniteTest):
             streamer.await_event("exchangeFreeSwitch=true", 60, from_the_beginning=True)
 
         for streamer in streamers:  # waiting for streaming continuation.
-            streamer.await_event("Application streamed", 60)
+            streamer.await_event("APPICATION_STREAMED", 60)
 
         for streamer in streamers:  # stops streaming and records results.
             streamer.stop_async()
diff --git a/modules/ducktests/tests/ignitetest/tests/pme_free_switch_test.py b/modules/ducktests/tests/ignitetest/tests/pme_free_switch_test.py
index 3b54762..7623ecb 100644
--- a/modules/ducktests/tests/ignitetest/tests/pme_free_switch_test.py
+++ b/modules/ducktests/tests/ignitetest/tests/pme_free_switch_test.py
@@ -87,6 +87,8 @@ class PmeFreeSwitchTest(IgniteTest):
 
         long_tx_streamer.stop()
 
+        single_key_tx_streamer.await_event("APPICATION_STREAMED", 60)  # waiting for streaming continuation.
+
         single_key_tx_streamer.stop()
 
         data["Worst latency (ms)"] = single_key_tx_streamer.extract_result("WORST_LATENCY")