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

fix: recreate services instances (Fixes #9) #11

Closed
wants to merge 1 commit into from

Conversation

gallardo
Copy link
Contributor

Due to gradle starting by default as daemon and many services configured guice singletons, configuration is read only on first gradle run. If these services are not explicitly reset, serenity configuration changes are ignored on subsequent gradle runs.

This commit fixes #9. It instructs guice to recreate many of these services when they are requested instead of reusing them.

Due to gradle starting by default as daemon and many services configured guice singletons, configuration is read only on first gradle run. If these services are not explicitly reset, serenity configuration changes are ignored on subsequent gradle runs.

This commit fixes serenity-bdd#9. It instructs guice to recreate many of these services when they are requested instead of reusing them.
@gallardo
Copy link
Contributor Author

Notice that this is a workaround and that it would be probably better if we used guice scopes to control the lifecycle of the instances.

I also have to admit that I couldn't understand the code to the point where I could have proposed a more performant solution. Recreating all these instances each time they are needed will have an impact on big projects.

@gallardo
Copy link
Contributor Author

gallardo commented May 31, 2022

Important: this commit requires serenity-bdd/serenity-core@c2bcb25, but this commit is currently only in master.

@gallardo
Copy link
Contributor Author

gallardo commented Jun 2, 2022

I'm experiencing more issues with this PR. I'm closing it for the moment until I see it clearer.

@gallardo gallardo closed this Jun 2, 2022
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.

Environment variables read only during first gradle run
1 participant