ascherbakoff commented on code in PR #4821: URL: https://github.com/apache/ignite-3/pull/4821#discussion_r1889908374
########## modules/table/src/integrationTest/java/org/apache/ignite/distributed/ItTxObservableTimePropagationTest.java: ########## @@ -70,20 +85,90 @@ protected int replicas() { @Override protected HybridClock createClock(ClusterNode node) { - // Client physical time is frozen in the past, server time advances normally. - return new TestHybridClock(() -> node.address().port() == CLIENT_PORT ? CLIENT_FROZEN_PHYSICAL_TIME : System.currentTimeMillis()); + int idx = NODE_PORT_BASE - node.address().port() + 1; + + // Physical time is frozen. + return new TestHybridClock( + () -> node.address().port() == CLIENT_PORT ? CLIENT_FROZEN_PHYSICAL_TIME : CLIENT_FROZEN_PHYSICAL_TIME + 1000L * idx); + } + + @Override + protected long getSafeTimePropagationTimeout() { + return 300_000; } @Test public void testImplicitObservableTimePropagation() { RecordView<Tuple> view = accounts.recordView(); view.upsert(null, makeValue(1, 100.0)); - TxManagerImpl clientTxManager = (TxManagerImpl) txTestCluster.clientTxManager; - Collection<TxStateMeta> states = clientTxManager.states(); + List<TxStateMeta> states = txTestCluster.states(); assertEquals(1, states.size()); - HybridTimestamp commitTs = states.iterator().next().commitTimestamp(); + HybridTimestamp commitTs = states.get(0).commitTimestamp(); + + LOG.info("commitTs={}", commitTs); + assertNotNull(commitTs); assertEquals(commitTs, timestampTracker.get()); - assertTrue(commitTs.getPhysical() != CLIENT_FROZEN_PHYSICAL_TIME, "Client time should be advanced to server time"); + + assertTrue(commitTs.compareTo(new HybridTimestamp(CLIENT_FROZEN_PHYSICAL_TIME, 0)) > 0, "Observable timestamp should be advanced"); + + TablePartitionId part = new TablePartitionId(accounts.tableId(), 0); + + NodeImpl[] handle = {null}; + NodeImpl[] leader = {null}; + + txTestCluster.raftServers().values().stream().map(Loza::server).forEach(s -> { + JraftServerImpl srv = (JraftServerImpl) s; + List<RaftGroupService> grps = srv.localNodes().stream().map(srv::raftGroupService).collect(toList()); Review Comment: This is not my code, by 🆗 -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org