Add flaky tests to test how testing for flaky tests works

This commit is contained in:
Alexander Lakhin
2025-05-14 11:31:45 +03:00
parent 52888e06a0
commit eba6f85909
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
"""Test for detecting new flaky tests"""
import random
def test_flaky1():
assert random.random() > 0.05
def no_test_flaky2():
assert random.random() > 0.05

View File

@@ -11,6 +11,9 @@ if TYPE_CHECKING:
# Test that pageserver and safekeeper can restart quickly.
# This is a regression test, see https://github.com/neondatabase/neon/issues/2247
def test_fixture_restart(neon_env_builder: NeonEnvBuilder):
import random
assert random.random() > 0.05
env = neon_env_builder.init_start()
for _ in range(3):
@@ -20,3 +23,9 @@ def test_fixture_restart(neon_env_builder: NeonEnvBuilder):
for _ in range(3):
env.safekeepers[0].stop()
env.safekeepers[0].start()
def test_flaky3():
import random
assert random.random() > 0.05