Skip to content

Commit 798e303

Browse files
zxqfd555Manul from Pathway
authored andcommitted
make nats tests more stable (#7689)
GitOrigin-RevId: 7677bfaa4f2d326d4860f1057d920d300adc721d
1 parent 92dd851 commit 798e303

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

integration_tests/kafka/test_nats.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import pathlib
22
from uuid import uuid4
33

4+
import pytest
5+
46
import pathway as pw
57
from pathway.internals.parse_graph import G
6-
from pathway.tests.utils import expect_csv_checker, wait_result_with_checker
8+
from pathway.tests.utils import CsvLinesNumberChecker, wait_result_with_checker
79

810
NATS_SERVER_URI = "nats://nats:4222/"
911

@@ -30,17 +32,13 @@ class InputSchema(pw.Schema):
3032
pw.io.csv.write(table_reread, output_file)
3133

3234
wait_result_with_checker(
33-
expect_csv_checker(
34-
"\n".join(["data"] + new_entries),
35-
output_file,
36-
usecols=["data"],
37-
index_col=["data"],
38-
),
39-
10,
35+
CsvLinesNumberChecker(output_file, len(new_entries)),
36+
30,
4037
kwargs={"persistence_config": persistence_config},
4138
)
4239

4340

41+
@pytest.mark.flaky(reruns=5)
4442
def test_nats_simple(tmp_path: pathlib.Path):
4543
nats_topic = f"nats-{uuid4()}"
4644
input_file = tmp_path / "input.txt"
@@ -51,6 +49,7 @@ def test_nats_simple(tmp_path: pathlib.Path):
5149
run(input_file, output_file, nats_topic, ["one", "two", "three", "four"])
5250

5351

52+
@pytest.mark.flaky(reruns=5)
5453
def test_nats_persistence(tmp_path: pathlib.Path):
5554
nats_topic = f"nats-{uuid4()}"
5655
input_file = tmp_path / "input.txt"

0 commit comments

Comments
 (0)