mirror of https://github.com/astral-sh/ruff
[ty] Fix flaky tests on macos (#21524)
We're seeing flaky test failures on macos, which seems to be caused by different Salsa ID orderings on the different platforms. Constraint set BDDs order their internal nodes based on the Salsa IDs of the interned typevar structs, and we had some code that depended on variable ordering in an unexpected way. This patch definitely fixes the macos test failure on #21414, and hopefully fixes it on #21436, too.
This commit is contained in:
parent
5dd56264fb
commit
ac9c83e581
|
|
@ -1524,7 +1524,10 @@ impl<'db> InteriorNode<'db> {
|
|||
.exists_one_inner(db, bound_typevar, map, path)
|
||||
})
|
||||
.unwrap_or(Node::AlwaysFalse);
|
||||
Node::new(db, self_constraint, if_true, if_false)
|
||||
// NB: We cannot use `Node::new` here, because the recursive calls might introduce new
|
||||
// derived constraints into the result, and those constraints might appear before this
|
||||
// one in the BDD ordering.
|
||||
Node::new_constraint(db, self_constraint).ite(db, if_true, if_false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue