zstan commented on a change in pull request #581:
URL: https://github.com/apache/ignite-3/pull/581#discussion_r792607063
##########
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 fix a bit, now execution tests runs 1 min, is it ok?
--
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]