Skip to content

Commit 3f879c4

Browse files
Merge pull request ClickHouse#80283 from ClickHouse/getreal
Maybe fix test_refreshable_mat_view_replicated::test_real_wait_refresh flakiness
2 parents c018493 + 1d8da03 commit 3f879c4

File tree

1 file changed

+5
-3
lines changed
  • tests/integration/test_refreshable_mat_view_replicated

1 file changed

+5
-3
lines changed

tests/integration/test_refreshable_mat_view_replicated/test.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,10 +412,12 @@ def test_real_wait_refresh(
412412
expected_rows += 2
413413
expect_rows(expected_rows, table=tgt)
414414

415+
is_close = lambda x, y: x is not None and y is not None and abs(x.timestamp() - y.timestamp()) <= 3
416+
415417
rmv2 = get_rmv_info(
416418
node,
417419
"test_rmv",
418-
condition=lambda x: x["last_refresh_time"] == rmv["next_refresh_time"],
420+
condition=lambda x: is_close(x["last_refresh_time"], rmv["next_refresh_time"]),
419421
# wait for refresh a little bit more than 10 seconds
420422
max_attempts=30,
421423
delay=0.5,
@@ -438,8 +440,8 @@ def test_real_wait_refresh(
438440

439441
assert rmv2["exception"] is None
440442
assert rmv2["status"] in ["Scheduled", "Running"]
441-
assert rmv2["last_success_time"] == rmv["next_refresh_time"]
442-
assert rmv2["last_refresh_time"] == rmv["next_refresh_time"]
443+
assert is_close(rmv2["last_success_time"], rmv["next_refresh_time"])
444+
assert is_close(rmv2["last_refresh_time"], rmv["next_refresh_time"])
443445
assert rmv2["retry"] == 0 and rmv22["retry"] == 0
444446

445447
for n in nodes:

0 commit comments

Comments
 (0)