Skip to content

Commit

Permalink
IGNITE-19880 Fix negative duration in the SQL query system view
Browse files Browse the repository at this point in the history
  • Loading branch information
Якимова Анастасия Николаевна authored and Якимова Анастасия Николаевна committed Sep 27, 2023
1 parent aa30338 commit ca15cd1
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import java.util.Set;
import java.util.UUID;
import java.util.concurrent.Callable;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -68,7 +67,6 @@
import org.apache.ignite.configuration.TopologyValidator;
import org.apache.ignite.internal.ClusterMetricsSnapshot;
import org.apache.ignite.internal.IgniteEx;
import org.apache.ignite.internal.IgniteInternalFuture;
import org.apache.ignite.internal.IgniteInterruptedCheckedException;
import org.apache.ignite.internal.IgniteNodeAttributes;
import org.apache.ignite.internal.cache.query.index.IndexProcessor;
Expand Down Expand Up @@ -679,10 +677,14 @@ public void testRunningQueriesView() throws Exception {
@Test
public void testRunningQueriesViewDuration() throws Exception {
IgniteEx ignite = startGrid(0);

SqlFieldsQuery sql = new SqlFieldsQuery("SELECT * FROM (VALUES (1),(2))").setPageSize(1);

for (int i = 0; i < 5; i++) {
ignite.context().query().querySqlFields(sql, true).iterator().hasNext();

SystemView<SqlQueryView> view = ignite.context().systemView().view(SQL_QRY_VIEW);

view.forEach(v -> assertTrue(v.duration() >= 0));
}
}
Expand Down

0 comments on commit ca15cd1

Please sign in to comment.