Skip to content

test: compare attribute names without relying on iteration order - #6707

Merged
peholmst merged 1 commit into
mainfrom
fix/attribute-test-order
Nov 19, 2026
Merged

peholmst merged 1 commit into
mainfrom
fix/attribute-test-order

Conversation

@totally-not-ai

@totally-not-ai totally-not-ai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The AttributeTest snippet test fails with Vaadin 25.4.0-alpha7 and later. It compared Element.getAttributeNames() against an ordered list, but that method doesn't specify an order. This failure blocks the main branch build.

What changed

  • The two assertions on attribute names now compare sets instead of lists. The test no longer depends on iteration order.
  • Root cause: Flow now stores element attributes in shared key sets (refactor: store multi-key NodeMap values in shared key layout flow#26333). Attribute names used to come back in HashMap order and now come back in the key set's order, which is usually insertion order.
  • The same snippet appears on the "Properties and Attributes" page, so readers now see an assertion that doesn't depend on order. No other docs text changes.

Test summary

  • The original test fails locally against 25.4.0-beta1 with the same error the deploy build shows. With this change it passes.
  • All Java tests in the project pass.

Working on behalf of Petter

Element.getAttributeNames() does not specify an order. Flow 25.4 stores
element attributes in shared key sets, so the names now come back in
insertion order instead of hash order and the list comparison fails.
@peholmst
peholmst marked this pull request as ready for review November 19, 2026 11:03

@vaadin-review-bot vaadin-review-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Nothing to flag — the changes look good.

@peholmst
peholmst merged commit 17bcda8 into main Nov 19, 2026
16 of 18 checks passed
@peholmst
peholmst deleted the fix/attribute-test-order branch November 19, 2026 11:12
peholmst pushed a commit that referenced this pull request Nov 19, 2026
## Summary

Pull requests never ran the Java tests under `src/test`. The Maven
workflow ran `mvn compile`, which builds only the main sources. A
failing snippet test could therefore merge with every check green, and
the first build to run it was the production docs deployment. That build
then failed until the test was fixed (see #6707).

## What changed

- The Maven Compile workflow now runs `mvn test --batch-mode
--no-transfer-progress` instead of `mvn compile`. A broken snippet test,
for example after a Vaadin version bump, now fails on the PR.
- The workflow and job names stay the same, so any required-check
configuration that refers to them keeps working.
- `CLAUDE.md`, `CONVENTIONS.md`, `guidelines/repository.md` and the code
review prompt now tell contributors to run `mvn test` locally instead of
`mvn compile`.

## Test summary

- `mvn test` passes locally on current `main`. It runs the existing
snippet tests in a few seconds.

Working on behalf of Petter

---------

Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants