[red-knot] Demote the `negation_reverses_subtype_order` test back to flaky (#16951)

Fixes #16913. See my analysis in the issue for the rationale
This commit is contained in:
Alex Waygood 2025-03-24 11:37:03 -04:00 committed by GitHub
parent 581b7005dc
commit 888a910925
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 15 additions and 6 deletions

View File

@ -103,12 +103,6 @@ mod stable {
forall types s, t. s.is_subtype_of(db, t) && t.is_subtype_of(db, s) => s.is_equivalent_to(db, t)
);
// If `S <: T`, then `~T <: ~S`.
type_property_test!(
negation_reverses_subtype_order, db,
forall types s, t. s.is_subtype_of(db, t) => t.negate(db).is_subtype_of(db, s.negate(db))
);
// `T` is not disjoint from itself, unless `T` is `Never`.
type_property_test!(
disjoint_from_is_irreflexive, db,
@ -286,4 +280,19 @@ mod flaky {
forall types s, t.
!s.is_disjoint_from(db, union(db, [s, t])) && !t.is_disjoint_from(db, union(db, [s, t]))
);
// If `S <: T`, then `~T <: ~S`.
//
// DO NOT STABILISE this test until the mdtests here pass:
// https://github.com/astral-sh/ruff/blob/2711e08eb8eb38d1ce323aae0517fede371cba15/crates/red_knot_python_semantic/resources/mdtest/type_properties/is_subtype_of.md?plain=1#L276-L315
//
// This test has flakes relating to those subtyping and simplification tests
// (see https://github.com/astral-sh/ruff/issues/16913), but it is hard to
// reliably trigger the flakes when running this test manually as the flakes
// occur very rarely (even running the test with several million seeds does
// not always reliably reproduce the flake).
type_property_test!(
negation_reverses_subtype_order, db,
forall types s, t. s.is_subtype_of(db, t) => t.negate(db).is_subtype_of(db, s.negate(db))
);
}