Skip to content

Commit 2e3b176

Browse files
author
Chris Cummins
committed
[tests] Mark flaky and xfail tests.
1 parent f97f697 commit 2e3b176

File tree

5 files changed

+13
-10
lines changed

5 files changed

+13
-10
lines changed

examples/example_compiler_gym_service/demo_without_bazel_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
# LICENSE file in the root directory of this source tree.
55
"""Smoke test for examples/example_compiler_gym_service/demo_without_bazel.py"""
66
from example_compiler_gym_service.demo_without_bazel import main
7+
from flaky import flaky
78

89

10+
@flaky
911
def test_demo_without_bazel():
1012
main()

examples/sensitivity_analysis/action_sensitivity_analysis_test.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,18 @@
44
# LICENSE file in the root directory of this source tree.
55
"""End-to-end test of //compiler_gym/bin:action_sensitivity_analysis."""
66

7-
import sys
87
import tempfile
98
from pathlib import Path
109

11-
import pytest
1210
from absl.flags import FLAGS
11+
from flaky import flaky
1312
from sensitivity_analysis.action_sensitivity_analysis import (
1413
run_action_sensitivity_analysis,
1514
)
1615
from sensitivity_analysis.sensitivity_analysis_eval import run_sensitivity_analysis_eval
1716

1817

19-
@pytest.mark.xfail(
20-
sys.platform == "darwin",
21-
strict=True,
22-
reason="github.com/facebookresearch/CompilerGym/issues/459",
23-
)
18+
@flaky
2419
def test_run_action_sensitivity_analysis():
2520
actions = [0, 1]
2621
env = "llvm-v0"

tests/llvm/datasets/csmith_test.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_csmith_from_seed_retry_count_exceeded(csmith_dataset: CsmithDataset):
6868
strict=True,
6969
reason="github.com/facebookresearch/CompilerGym/issues/459",
7070
)
71-
@flaky(rerun_filter=lambda err, *args: issubclass(err[0], ServiceError))
71+
@flaky(max_runs=5, rerun_filter=lambda err, *args: issubclass(err[0], ServiceError))
7272
def test_csmith_positive_runtimes(env: LlvmEnv, csmith_dataset: CsmithDataset):
7373
benchmark = next(csmith_dataset.benchmarks())
7474
env.reset(benchmark=benchmark)
@@ -82,7 +82,7 @@ def test_csmith_positive_runtimes(env: LlvmEnv, csmith_dataset: CsmithDataset):
8282
strict=True,
8383
reason="github.com/facebookresearch/CompilerGym/issues/459",
8484
)
85-
@flaky(rerun_filter=lambda err, *args: issubclass(err[0], ServiceError))
85+
@flaky(max_runs=5, rerun_filter=lambda err, *args: issubclass(err[0], ServiceError))
8686
def test_csmith_positive_buildtimes(env: LlvmEnv, csmith_dataset: CsmithDataset):
8787
benchmark = next(csmith_dataset.benchmarks())
8888
env.reset(benchmark=benchmark)

tests/llvm/fork_env_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
# LICENSE file in the root directory of this source tree.
55
"""Tests for LlvmEnv.fork()."""
66
import subprocess
7+
import sys
8+
9+
import pytest
710

811
from compiler_gym.envs import LlvmEnv
912
from compiler_gym.util.runfiles_path import runfiles_path
@@ -201,6 +204,10 @@ def test_fork_modified_ir_is_the_same(env: LlvmEnv):
201204
assert "\n".join(env.ir.split("\n")[1:]) == "\n".join(fkd.ir.split("\n")[1:])
202205

203206

207+
@pytest.mark.xfail(
208+
sys.platform == "darwin",
209+
reason="github.com/facebookresearch/CompilerGym/issues/459",
210+
)
204211
def test_fork_rewards(env: LlvmEnv, reward_space: str):
205212
"""Test that rewards are equal after fork() is called."""
206213
env.reward_space = reward_space

tests/llvm/fresh_environment_observation_reward_test.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
@pytest.mark.xfail(
1818
sys.platform == "darwin",
19-
strict=True,
2019
reason="github.com/facebookresearch/CompilerGym/issues/459",
2120
)
2221
@flaky # Runtime can timeout

0 commit comments

Comments
 (0)