diff --git a/test/conftest.py b/test/conftest.py index f4f4c255526fe9ae224f5e595b2ee42093e9bb22..a443738cfd34e292daacbe2146a7834b3098049d 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -49,7 +49,7 @@ from pathlib import Path # pub const INVALID_ID: u64 = 0; INVALID_RAFT_ID = 0 BASE_HOST = "127.0.0.1" -PORT_RANGE = 200 +PORT_RANGE = 400 METRICS_PORT = 7500 MAX_LOGIN_ATTEMPTS = 4 diff --git a/test/int/test_couple.py b/test/int/test_couple.py index 56928be131f416f352ca23a05b1e2db81129314b..9b0c38e09a425176319b47fbe193cbaefe007680 100644 --- a/test/int/test_couple.py +++ b/test/int/test_couple.py @@ -91,10 +91,10 @@ def test_restart_both(cluster2: Cluster): # This synchronization is necessary for proper test case reproducing. # i1 has already initialized raft node but can't win election yet # i2 starts discovery and should be able to advance further - Retriable(timeout=2, rps=10).call(check_alive, i1) + Retriable(timeout=10, rps=10).call(check_alive, i1) i2.start() - Retriable(timeout=2, rps=10).call(check_alive, i2) + Retriable(timeout=10, rps=10).call(check_alive, i2) # Speed up elections i2.promote_or_fail() diff --git a/test/int/test_sharding.py b/test/int/test_sharding.py index fb13ccd11832dfa003bcd985e2ddf467b51b7c77..014874db58277ec25f390d02d97fb5471e6b2ffc 100644 --- a/test/int/test_sharding.py +++ b/test/int/test_sharding.py @@ -293,7 +293,7 @@ def test_gitlab_763_no_missing_buckets_after_proc_sharding_failure(cluster: Clus # Instance cannot become online until vshard is reconfigured with pytest.raises(AssertionError): - i3.wait_online(timeout=2) + i3.wait_online() # Disable the synthetic failure so that instance can come online i1.call("pico._inject_error", "PROC_SHARDING_SPURIOUS_FAILURE", False) diff --git a/test/int/test_snapshot.py b/test/int/test_snapshot.py index b9ad807e7e11d5d10b50b5a3c8c2e610d5e178fb..f73baca03aa3d00ba2140540c7d29c158b38f53f 100644 --- a/test/int/test_snapshot.py +++ b/test/int/test_snapshot.py @@ -1,5 +1,7 @@ import time +import pytest + from conftest import Cluster, Retriable @@ -66,6 +68,9 @@ def assert_eq(lhs, rhs): assert lhs == rhs +@pytest.mark.xfail( + reason="flaky, see: https://git.picodata.io/core/picodata/-/issues/779" +) def test_large_snapshot(cluster: Cluster): i1, i2, i3, i4 = cluster.deploy(instance_count=4) diff --git a/test/pgproto/user_can_read_from_query_cache_test.py b/test/pgproto/user_can_read_from_query_cache_test.py index bfb5a9b675b559229b872a52a8cf4476070cb0b3..478a65653d5201262fd0f078f2e68a03f50d6883 100644 --- a/test/pgproto/user_can_read_from_query_cache_test.py +++ b/test/pgproto/user_can_read_from_query_cache_test.py @@ -1,4 +1,4 @@ -from conftest import Postgres +from conftest import Postgres, Retriable import psycopg @@ -32,13 +32,18 @@ def test_user_can_read_from_query_cache(postgres: Postgres): """, ) - # put this query in the query cache - cur = conn.execute( - """ + def select_returns_inserted(): + cur = conn.execute( + """ SELECT * FROM "t"; """, - ) - assert sorted(cur.fetchall()) == [(1,), (2,)] + ) + assert sorted(cur.fetchall()) == [(1,), (2,)] + + # put this query in the query cache + # we have to retry because of vshard rebalancing problems + # see https://git.picodata.io/core/sbroad/-/issues/848 + Retriable().call(select_returns_inserted) # get this query from the cache cur = conn.execute(