-
Notifications
You must be signed in to change notification settings - Fork 236
Do not persist a driver instance in the configuration object but in the browser #266
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
base: master
Are you sure you want to change the base?
Conversation
b04a389
to
32e84f4
Compare
Hey! Thanks for working to contribute. I can see from CI (and from checking it out locally), that this breaks the To be clear, I think the problem you describe of driver objects getting recycled even when they definitely shouldn't be is a problem. I'm concerned, though, that the test failures indicate we'd actually be breaking a part of the API contract (even if it's only implicit). Can I ask a bit more about the scenarios where this problem pops up? I'm trying to wrap my head around what a "best fix" would be. |
Actually, this is kind of a multi-part regression, and I think this should indeed be the proper way to fix it. Before commit 6f2117e (i.e. version
This was how it is supposed to be. With the following commit 84466aa (i.e. version
With commit 08d1a0d (i.e. version
So currently with the built-in
For case 1 there is no difference with this PR merged, because whether you create new configuration objects or not is irrelevant. For case 2 there is no difference with this PR merged, because the Case 3 is where the difference is, because you configured that you do not want the Especially if you combine case 3 with My currently work-around for this is to effectively revert the geb/issues#660 performance boost by using my own base spec that uses Another case where behaviour changes is, if you try to follow the Book of Geb paragraph
While technically correct, the methods are currently effectively useless if you use the built-in integrations, because there is never a new "default driver" requested, as the I have no idea why the CI has test failures. Looking at |
Ah, ok, it did not do anything because you cannot run one of these tests alone, it forcibly waits until both are started to ensure they run in parallel. |
Before this PR the driver instance was persisted in the configuration object.
So if the same configuration object was used, the same driver was used.
This happens for example when using a
GebTestManager
which persists a configuration per threadand uses that in the browser creator if no custom one was set.
This causes for example the same driver to be used multiple times, even if
cacheDriver
is set to false.And more prominent, if
quitDriverOnBrowserReset
is enabled, then after the reset the driver is still used,but as it is quit already, throws exceptions.
With this PR, the driver is no longer persisted in the configuration instance,
but in the browser instance, and the congiuration is only used to create new driver instances.