GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Avoid `NullPointerException` when deserializing `TestIdentifier` by dmlloyd · Pull Request #3820 · junit-team/junit-framework

Conversation

@dmlloyd

@dmlloyd dmlloyd commented May 16, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Overview

Fix NullPointerException when a TestIdentifier with no parentId is deserialized.

Issue: #3819


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done

  • There are no TODOs left in the code
  • Method preconditions are checked and documented in the method's Javadoc
  • Coding conventions (e.g. for logging) have been followed
  • Change is covered by automated tests including corner cases, errors, and exception handling
  • Public API has Javadoc and @API annotations
  • Change is documented in the User Guide and Release Notes

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

geoand reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@marcphilipp marcphilipp linked an issue May 16, 2024 that may be closed by this pull request
NullPointerException when deserializing TestIdentifier #3819
Closed
1 task done
marcphilipp
marcphilipp requested changes May 16, 2024
View reviewed changes

@marcphilipp marcphilipp left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Thanks for reporting and providing a fix! Could you please add a test to org.junit.platform.launcher.TestIdentifierTests to cover this scenario? It should suffice to serialize and deserialize TestIdentifier.from(engineDescriptor).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

dmlloyd reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@dmlloyd
Fix NPE when deserializing TestIdentifier
4056f66
Issue: junit-team#3819
@dmlloyd
dmlloyd force-pushed the fix-3819 branch from cf08bb7 to 4056f66 Compare May 16, 2024 15:09
@dmlloyd

dmlloyd commented May 16, 2024

Copy link
Copy Markdown
Contributor Author

I've pushed up a test (and good thing too, because it uncovered a second place where the problem occurs). I don't really understand how the descriptors and identifiers work together though so I just created an anonymous instance of TestDescriptors with the exact characteristics that trigger the problem. Is that OK?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dmlloyd

dmlloyd commented May 16, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Hmm CI is failing due to a spotless check for a file I didn't touch: https://github.com/junit-team/junit5/actions/runs/9114769155/job/25059506872?pr=3820#step:3:731

Did I mess something up somehow?

To quote the great man: "I wasn't even in aisle seven!"

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dmlloyd

dmlloyd commented May 16, 2024

Copy link
Copy Markdown
Contributor Author

Also one more question... is there any chance that this change could be backported into a 5.10.3 release?

geoand and holly-cummins reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marcphilipp added 2 commits May 16, 2024 17:19
@marcphilipp
Polish test
85a300c
@marcphilipp
Merge branch 'main' into fix-3819
8554cb5
@marcphilipp

marcphilipp commented May 16, 2024

Copy link
Copy Markdown
Member

I don't really understand how the descriptors and identifiers work together though so I just created an anonymous instance of TestDescriptors with the exact characteristics that trigger the problem. Is that OK?

I polished the test to make it more like the others in that class in 85a300c.

Hmm CI is failing due to a spotless check for a file I didn't touch: junit-team/junit5/actions/runs/9114769155/job/25059506872?pr=3820#step:3:731

Did I mess something up somehow?

That was my bad. Earlier today, I pushed something to main that broke that. I just fixed it and merged the fix into your branch. Should be good now.

Also one more question... is there any chance that this change could be backported into a 5.10.3 release?

Would a 5.11.0-M2 release also work for you?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

marcphilipp
marcphilipp approved these changes May 16, 2024
View reviewed changes
@dmlloyd

dmlloyd commented May 16, 2024

Copy link
Copy Markdown
Contributor Author

I don't really understand how the descriptors and identifiers work together though so I just created an anonymous instance of TestDescriptors with the exact characteristics that trigger the problem. Is that OK?

I polished the test to make it more like the others in that class in 85a300c.

Great! Thanks.

Hmm CI is failing due to a spotless check for a file I didn't touch: junit-team/junit5/actions/runs/9114769155/job/25059506872?pr=3820#step:3:731
Did I mess something up somehow?

That was my bad. Earlier today, I pushed something to main that broke that. I just fixed it and merged the fix into your branch. Should be good now.

Awesome!

Also one more question... is there any chance that this change could be backported into a 5.10.3 release?

Would a 5.11.0-M2 release also work for you?

I'm not sure; I'll follow up once I've consulted with the team.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@geoand

geoand commented May 16, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Would a 5.11.0-M2 release also work for you?

Is there any chance we can see a preliminary changelog for 5.11?
We have never encountered any issues upgrading in the past, but I would nevertheless like us to do our due diligence :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marcphilipp

marcphilipp commented May 16, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Sure, here are the release notes for M1 and the preliminary ones for M2.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@geoand

geoand commented May 16, 2024

Copy link
Copy Markdown

Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@marcphilipp
marcphilipp merged commit bc55d0e into junit-team:main May 16, 2024
@dmlloyd
dmlloyd deleted the fix-3819 branch May 16, 2024 15:56
@marcphilipp

marcphilipp commented May 17, 2024

Copy link
Copy Markdown
Member

@dmlloyd @geoand We just released 5.11.0-M2

dmlloyd reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@geoand

geoand commented May 17, 2024

Copy link
Copy Markdown

🙏

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@geoand

geoand commented May 22, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

@marcphilipp thanks again, for the release!
We tried and it and this fix works expected, however because the milestone release has some other effects that we would ideally like to avoid dealing with until a GA, release, is there any chance we could get a 5.10.3?

Thanks a lot

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@holly-cummins holly-cummins mentioned this pull request May 29, 2024
Revert test serializer changes to avoid regressing existing use cases quarkusio/quarkus#40880
Merged
@dmlloyd

dmlloyd commented May 29, 2024

Copy link
Copy Markdown
Contributor Author

And relatedly, would it be useful if I put up a backport of this PR to the 5.10.x branch?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dmlloyd dmlloyd mentioned this pull request May 30, 2024
Avoid NullPointerException when deserializing TestIdentifier #3837
Closed
6 tasks done
@dmlloyd

dmlloyd commented May 30, 2024

Copy link
Copy Markdown
Contributor Author

Just in case, I've opened #3837.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sbrannen sbrannen added type: bug component: Platform labels May 31, 2024
@sbrannen sbrannen mentioned this pull request May 31, 2024
Backport selected bug fixes to 5.10.3 #3838
Closed
8 tasks done
@sbrannen

sbrannen commented May 31, 2024

Copy link
Copy Markdown
Member

@dmlloyd and @geoand,

I've opened #3838 so the team can consider backporting selected bug fixes to 5.10.x.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@geoand

geoand commented May 31, 2024

Copy link
Copy Markdown

Thanks a lot @sbrannen!

sbrannen reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sbrannen sbrannen changed the title Fix NPE when deserializing TestIdentifier Fix NullPointerException when deserializing TestIdentifier May 31, 2024
@sbrannen sbrannen changed the title Fix NullPointerException when deserializing TestIdentifier Avoid NullPointerException when deserializing TestIdentifier May 31, 2024
marcphilipp pushed a commit that referenced this pull request Jun 17, 2024
@dmlloyd @marcphilipp
Fix NPE when deserializing TestIdentifier (#3820)
d29e3eb
An NPE was thrown when (de)serializing `TestIdentifiers` without a parent.

Fixes #3819.

Co-authored-by: Marc Philipp <[email protected]>

(cherry picked from commit bc55d0e)
@holly-cummins holly-cummins mentioned this pull request Jun 18, 2024
can't get field offset on a record class using quarkus-junit5 quarkusio/quarkus#40148
Closed
@holly-cummins holly-cummins mentioned this pull request Jun 28, 2024
Reinstate changes to use JBoss serializer instead of xstream quarkusio/quarkus#40906
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@marcphilipp marcphilipp marcphilipp approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

component: Platform type: bug

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

NullPointerException when deserializing TestIdentifier

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@dmlloyd @marcphilipp @geoand @sbrannen
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.