Skip to content

testlib: include generator context in assertion failures - #8917

Open
DevNeto07 wants to merge 3 commits into
google:masterfrom
DevNeto07:Atualização/7585-ready-20261126

Hidden character warning

The head ref may contain hidden characters: "Atualiza\u00e7\u00e3o/7585-ready-20261126"
Open

DevNeto07 wants to merge 3 commits into
google:masterfrom
DevNeto07:Atualização/7585-ready-20261126

Conversation

@DevNeto07

Copy link
Copy Markdown

Refs #7585.

Attach a stackless suppressed diagnostic containing the suite and generator class to JUnit 3 assertion failures. Preserve the original failure object and existing suppressed context; successful tests and non-assertion failures keep their existing behavior.

Unwrap size and derived generators with a bounded traversal, including cyclic, fresh-wrapper and null-delegate cases. Metadata failures do not mask the original assertion; VirtualMachineError and ThreadDeath continue to propagate.

Includes 14 focused regression tests. Opaque serialization wrappers may still identify a testlib generator rather than the caller's generator; test names and runner UI are unchanged. The JUnit 3 lifecycle additions are excluded from GWT/J2KT; the Android mirror is left to the project's normal synchronization.

Validation: focused isolated JUnit run against current upstream-derived classes: 3,788 executions passed on Windows/Temurin 17. The same run passed on Linux/Temurin 17. Focused Maven reactor validation also passed: 3,788 executions, zero failures/errors/skips, with Animal Sniffer passing (compiler JDK 27, runtime Temurin 17). Full guava-tests, Android and GWT/J2KT suites were not run.

Attach a compact suppressed diagnostic without changing the original failure or test name. Unwrap supported generator wrappers with bounded traversal and preserve assertions when diagnostic metadata fails. Keep JVM lifecycle code excluded from GWT and J2KT, and cover diagnostic edge cases.

Refs google#7585
Handle nonfatal Error subclasses from third-party generators without replacing the original assertion. Continue propagating VirtualMachineError and ThreadDeath, and add regressions for all three paths.

Refs google#7585

This branch has not been deployed

No deployments
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.

1 participant