File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 1+ import multiprocessing
12import shutil
23import sqlite3
34from pathlib import Path
45
6+ import pytest
7+
58from codeflash .benchmarking .plugin .plugin import codeflash_benchmark_plugin
69from codeflash .benchmarking .replay_test import generate_replay_test
710from codeflash .benchmarking .trace_benchmarks import trace_benchmarks_pytest
@@ -174,6 +177,11 @@ def test_code_to_optimize_bubble_sort_codeflash_trace_sorter():
174177 output_file .unlink (missing_ok = True )
175178 shutil .rmtree (replay_tests_dir )
176179
180+ # Skip the test if the machine has only 1 thread/CPU
181+ @pytest .mark .skipif (
182+ multiprocessing .cpu_count () <= 1 ,
183+ reason = "This test requires more than 1 CPU thread"
184+ )
177185def test_trace_multithreaded_benchmark () -> None :
178186 project_root = Path (__file__ ).parent .parent / "code_to_optimize"
179187 benchmarks_root = project_root / "tests" / "pytest" / "benchmarks_multithread"
You can’t perform that action at this time.
0 commit comments