Skip to content

Commit 667ed3b

Browse files
mlim19claude
andcommitted
Add auto-retry for flaky PyPerf test to improve CI stability
The test_dso_name_in_pyperf_profile test occasionally fails due to PyPerf timeouts, particularly with Python 2.7. This is caused by timing issues in CI environments where PyPerf may not generate profile files within the 5-second timeout. Changes: - Add pytest-rerunfailures==15.0 to dev-requirements.txt - Mark test_dso_name_in_pyperf_profile with @pytest.mark.flaky(reruns=3, reruns_delay=2) The test will now automatically retry up to 3 times with a 2-second delay between attempts, which should handle sporadic timeout issues while still catching genuine failures. Related issue: Sporadic test failure observed in CI runs Example failure: https://github.com/intel/gprofiler/actions/runs/19146096101/job/54734480910 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f96a4f3 commit 667ed3b

2 files changed

Lines changed: 2 additions & 0 deletions

File tree

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
pytest==8.3.5
2+
pytest-rerunfailures==15.0
23
flake8==7.2.0
34
black==25.1.0
45
mypy==1.15.0

tests/test_python.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ def test_python_matrix(
161161
assert profile.app_metadata["sys_maxunicode"] is None
162162

163163

164+
@pytest.mark.flaky(reruns=3, reruns_delay=2)
164165
@pytest.mark.parametrize("in_container", [True])
165166
@pytest.mark.parametrize("profiler_type", ["pyperf"])
166167
@pytest.mark.parametrize("insert_dso_name", [False, True])

0 commit comments

Comments
 (0)