Skip to content

Commit fe953e5

Browse files
authored
[ty] skip a slow seed in fuzzer (astral-sh#20161)
## Summary Fuzzer seed 208 seems to be timing out all fuzzer runs on PRs today. This has happened on multiple unrelated PRs, as well as on an initial version of this PR that made a comment-only change in ty and didn't skip any seeds, so the timeout appears to be consistent in CI, on ty main branch, as of today, but it started happening due to some change in a factor outside ty; not sure what. I checked the code generated for seed 208 locally, and it takes about 30s to check on current ty main branch. This is slow for a fuzzer seed, but shouldn't be slow enough to make it time out after 20min in CI (even accounting for GH runners being slower than my laptop.) I tried to bisect the slowness of checking that code locally, but I didn't go back far enough to find the change that made it slow. In fact it seems like it became significantly faster in the last few days (on an older checkout I had to stop it after several minutes.) So whatever the cause of the slowness, it's not a recent change in ty. I don't want to rabbit-hole on this right now (fuzzer-discovered issues are lower-priority than real-world-code issues), and need a working CI, so skip this seed for now until we can investigate it. ## Test Plan CI. This PR contains a no-op (comment) change in ty, so that the fuzz test is triggered in CI and we can verify it now works (as well as verify, on the previous commit, that the fuzzer job is timing out on that seed, even with just a no-op change in ty.)
1 parent 0bf5d2a commit fe953e5

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

crates/ty_python_semantic/src/types.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub(crate) struct IsDisjoint;
191191
pub(crate) type IsEquivalentVisitor<'db, C> = PairVisitor<'db, IsEquivalent, C>;
192192
pub(crate) struct IsEquivalent;
193193

194-
/// A [`CycleDetector`] for `find_legacy_typevars` methods.
194+
/// A [`CycleDetector`] that is used in `find_legacy_typevars` methods.
195195
pub(crate) type FindLegacyTypeVarsVisitor<'db> = CycleDetector<FindLegacyTypeVars, Type<'db>, ()>;
196196
pub(crate) struct FindLegacyTypeVars;
197197

python/py-fuzzer/fuzz.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,16 @@ def print_description(self, index: int, num_seeds: int) -> None:
152152

153153
def fuzz_code(seed: Seed, args: ResolvedCliArgs) -> FuzzResult:
154154
"""Return a `FuzzResult` instance describing the fuzzing result from this seed."""
155+
# TODO(carljm) debug slowness of this seed
156+
skip_check = seed in {208}
157+
155158
code = generate_random_code(seed)
156159
bug_found = False
157160
minimizer_callback: Callable[[str], bool] | None = None
158161

159162
if args.baseline_executable_path is None:
160163
only_new_bugs = False
161-
if contains_bug(
164+
if not skip_check and contains_bug(
162165
code, executable=args.executable, executable_path=args.test_executable_path
163166
):
164167
bug_found = True
@@ -169,7 +172,7 @@ def fuzz_code(seed: Seed, args: ResolvedCliArgs) -> FuzzResult:
169172
)
170173
else:
171174
only_new_bugs = True
172-
if contains_new_bug(
175+
if not skip_check and contains_new_bug(
173176
code,
174177
executable=args.executable,
175178
test_executable_path=args.test_executable_path,

0 commit comments

Comments
 (0)