korlov42 commented on a change in pull request #581:
URL: https://github.com/apache/ignite-3/pull/581#discussion_r792456755



##########
File path: 
modules/sql-engine/src/test/java/org/apache/ignite/internal/sql/engine/exec/rel/AbstractExecutionTest.java
##########
@@ -90,6 +116,66 @@ private void handle(Thread t, Throwable ex) {
         return fields;
     }
 
+    /** Task reordering executor. */
+    private static class IgniteTestStripedThreadPoolExecutor extends 
StripedThreadPoolExecutor {
+        final Deque<Pair<Runnable, Integer>> tasks = new ArrayDeque<>();
+
+        /** Internal stop flag. */
+        AtomicBoolean stop = new AtomicBoolean();
+
+        /** Inner execution service. */
+        ExecutorService exec = Executors.newWorkStealingPool();
+
+        /** {@inheritDoc} */
+        public IgniteTestStripedThreadPoolExecutor(
+                int concurrentLvl,
+                String threadNamePrefix,
+                Thread.UncaughtExceptionHandler exHnd,
+                boolean allowCoreThreadTimeOut,
+                long keepAliveTime
+        ) {
+            super(concurrentLvl, threadNamePrefix, exHnd, 
allowCoreThreadTimeOut, keepAliveTime);
+
+            IgniteTestUtils.runAsync(() -> {
+                while (!stop.get()) {
+                    synchronized (tasks) {
+                        while (!tasks.isEmpty()) {
+                            Pair<Runnable, Integer> r = tasks.pollFirst();
+
+                            exec.execute(() -> {
+                                
LockSupport.parkNanos(ThreadLocalRandom.current().nextLong(0, 10_000));

Review comment:
       I don't think it's a good idea to introduce random delays up to 10 
seconds to all the tests. For several classes this increases an execution time 
on order of magnitude. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to