Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
Rette66 authored and manusa committed Jan 3, 2024
1 parent d70267d commit 73df8d3
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,13 @@ class AttributeSetTest extends Specification {
when:
AttributeSet attributeSet = new AttributeSet(a2)
AttributeSet selectorWithOne = new AttributeSet(a2)
AttributeSet selectorWithTwo = new AttributeSet(a2, a3);
AttributeSet selectorWithTwo = new AttributeSet(a2, a3)
def orderedAttributes = new LinkedHashSet([a2, a3]);
then:

// Assert that the order is suitable for testing. The failing attribute should
// be in the *second* position to ensure we're examining all the values of the selector
assert new ArrayList<>(selectorWithTwo.attributes.values()).indexOf(a3) == 1;
assert new ArrayList<>(orderedAttributes).indexOf(a3) == 1;

assert attributeSet.matches(selectorWithOne)
assert !attributeSet.matches(selectorWithTwo)
Expand Down

0 comments on commit 73df8d3

Please sign in to comment.