quarkusio/quarkus · error · RuntimeException

Incorrect description: " + i3.getDescription() + "…

Error message

Incorrect description: " + i3.getDescription() + ", expected: " + expectedDesc[2]

What it means

Same assertion pattern for the third Item (id=3): em.find(Item.class, 3L) must return an Item whose description equals expectedDesc[2], otherwise this RuntimeException is thrown. Part of the Item entity-cache verification that all three cached items match the expected descriptions.

Solutions

  1. Evict the Item entity region before verification
  2. Reset seed data to guarantee Item 3's description matches expectedDesc[2]
  3. Trace whether the update phase persisted the new description for Item 3
  4. Clear the cache and rerun to distinguish cache staleness from data issues

Example fix

// before
final Item i3 = em.find(Item.class, 3L);
if (!i3.getDescription().equals(expectedDesc[2])) throw ...
// after
sessionFactory.getCache().evict(Item.class);
final Item i3 = em.find(Item.class, 3L);
if (!i3.getDescription().equals(expectedDesc[2])) throw ...
Defensive patterns

Strategy: validation

Validate before calling

sessionFactory.getCache().evict(Item.class);
Item i3 = em.find(Item.class, 3L);
if (i3 == null) throw new IllegalStateException("Item 3 not seeded");

Try / catch

try {
    findByIdItems(em, expectedDesc);
} catch (RuntimeException e) {
    sessionFactory.getCache().evict(Item.class);
    // reload; persistent mismatch indicates a seed/update bug
}

Prevention

When it happens

Trigger: Verifying cached Items when Item 3's cached or persisted description differs from expectedDesc[2] — stale cache after updates, prior-run mutations, or wrong seed data.

Common situations: Entity cache retaining pre-update descriptions; Item 3 changed by a previous failed run; expected values in the caller not matching the seed/update logic.

Related errors


AI-assisted analysis of quarkusio/quarkus@e1c734241f (2026-09-05). Data as JSON: /api/errors/6f6fc85a3923d128. Report an issue: GitHub.

Appendix: source

Thrown at integration-tests/hibernate-orm-cache/src/main/java/io/quarkus/it/hibernate/orm/cache/HibernateOrmCacheTestEndpoint.java:374

        QuarkusTransaction.requiringNew().run(() -> {
            findByIdItems(em, expectedDesc);
        });

        assertRegionStats(expected, Item.class.getName());
    }

    private static void findByIdItems(EntityManager em, String[] expectedDesc) {
        final Item i1 = em.find(Item.class, 1L);
        if (!i1.getDescription().equals(expectedDesc[0]))
            throw new RuntimeException("Incorrect description: " + i1.getDescription() + ", expected: " + expectedDesc[0]);

        final Item i2 = em.find(Item.class, 2L);
        if (!i2.getDescription().equals(expectedDesc[1]))
            throw new RuntimeException("Incorrect description: " + i2.getDescription() + ", expected: " + expectedDesc[1]);

        final Item i3 = em.find(Item.class, 3L);
        if (!i3.getDescription().equals(expectedDesc[2]))
            throw new RuntimeException("Incorrect description: " + i3.getDescription() + ", expected: " + expectedDesc[2]);

        List<Item> allitems = Arrays.asList(i1, i2, i3);
        if (allitems.size() != 3) {
            throw new RuntimeException("Incorrect number of results");
        }
        StringBuilder sb = new StringBuilder("list of stored Items names:\n\t");
        for (Item p : allitems)
            p.describeFully(sb);

        sb.append("\nList complete.\n");
        System.out.print(sb);
    }

    private void testQuery() {
        //Load all persons and run some checks on the query results:
        Map<String, Counts> counts = new TreeMap<>();
        counts.put(Person.class.getName(), new Counts(4, 0, 0, 4));
        counts.put(RegionFactory.DEFAULT_QUERY_RESULTS_REGION_UNQUALIFIED_NAME, new Counts(1, 0, 1, 1));

View on GitHub (pinned to e1c734241f)