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

Concurrency issue when running multiple HtmlSanityCheck tasks in parallel #211

Open
thc202 opened this issue Sep 14, 2018 · 5 comments
Open

Comments

@thc202
Copy link
Contributor

thc202 commented Sep 14, 2018

When running Gradle with --parallel flag and with multiple subprojects configured with HtmlSanityCheck it might happen that the configurations of one subproject end up being used by other, for example:

> Task :addons:alertFilters:htmlSanityCheck
/zap-extensions/addons/alertFilters/src/main/resources

> Task :addons:browserView:htmlSanityCheck
/zap-extensions/addons/alertFilters/src/main/resources

BUILD SUCCESSFUL in 39s
96 actionable tasks: 4 executed, 92 up-to-date

(The plugin was tweaked to print the source being used, to show the issue more easily.)

The second task :addons:browserView:htmlSanityCheck should be using its own source directory (/zap-extensions/addons/browserView/src/main/resources) instead of the one from the other subproject.

From an initial investigation this seems to be caused by the Configuration being a singleton, so configurations set by one task might be used/overridden by others.

@gernotstarke
Copy link
Member

oops - I just recently re-implemented Configuration to be a Registry & Singleton to avoid having to pass around config-instances all over the code...

Didn't take that kind of parallel usage into account - any idea for a resolution?

@gernotstarke
Copy link
Member

Seems we have to bite the bullet and refactor to configuration INSTANCES instead of a REGISTRY again. I'll try that on a branch off 1.0.0-RC-2.

@thc202
Copy link
Contributor Author

thc202 commented Sep 19, 2018

If it's fine adding other dependencies to the plugin (Guice?), with dependency injection maybe? It would not require passing the configuration around (not explicitly/manually at least).

thc202 referenced this issue Sep 19, 2018
…ks fine locally)...

don't want to debug Travis-CI, so I remove 503 from the list of statuscodes to be tested...
@gernotstarke
Copy link
Member

@thc202, could you possibly supply a regression test for it? The class 'HtmlSanityCheckTaskFunctionalTest' might provide an idea...

I'm currently refactoring Configuration back to instance-based (instead of registry-based).

@gernotstarke
Copy link
Member

should be fixed with 1.0.0-RC-2, which I just published to gradle plugin portal... could you please verify? thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants