Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(test): improving EmbeddedRuntime exception handling #4685

Merged
merged 1 commit into from
Dec 19, 2024

Conversation

ndr-brt
Copy link
Member

@ndr-brt ndr-brt commented Dec 19, 2024

What this PR changes/adds

Avoids unnecessary exception wrapping in the EmbeddedRuntime boot method

Why it does that

improve test failure message

Further notes

  • changed the way the properties are provided to the runtime, legacy way was to set them tosystem properties, I changed this behavior by registering a ConfigurationExtension that will load them into a Config object directly, more EDC-y :)

Linked Issue(s)

Closes # <-- insert Issue number if one exists

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@ndr-brt ndr-brt added the refactoring Cleaning up code and dependencies label Dec 19, 2024
Copy link
Contributor

@jimmarino jimmarino left a comment

Choose a reason for hiding this comment

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

One comment about the TCCL that should be fixed in another PR


super.boot(false);
Thread.currentThread().setContextClassLoader(classLoader);
Copy link
Contributor

Choose a reason for hiding this comment

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

I just saw this now. Technically this should reset the previous classloader for the TCCL in a finally block (on error) or when the runtime shuts down. Probably for another PR.

Copy link
Member Author

@ndr-brt ndr-brt Dec 19, 2024

Choose a reason for hiding this comment

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

It shouldn't be necessary as this code runs in a separated thread, so this classloader assignment is done only for the specific thread

Copy link
Member Author

Choose a reason for hiding this comment

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

it's currently working like this:

Thread.currentThread().setContextClassLoader(classLoader);

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that could be a problem. Something to fix in another PR.

@ndr-brt ndr-brt merged commit 243ebc9 into eclipse-edc:main Dec 19, 2024
23 checks passed
@ndr-brt ndr-brt deleted the fix-test branch December 19, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Cleaning up code and dependencies
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants