martin-ober commented on issue #288:
URL: https://github.com/apache/groovy-geb/issues/288#issuecomment-3335545504

   After a first quick look at a diff to version 7.0, I suspect that the change 
in CachingDriverFactory.clearCache() does not return a driver instance and 
therefore driver.quit() is not executed.
   I made a test call in my restart handling
   ```
       if (doRestart) {
           println "#### CachingDriverFactory.clearCache(): 
${CachingDriverFactory.clearCache()}"
           CachingDriverFactory.clearCacheAndQuitDriver()
       }
   ```
   And so i can verify my assumption that the cache handling is not working 
like before, when i can see the output
   ```
   #### CachingDriverFactory.clearCache(): null
   ```
   
   the problem is in `CachingDriverFactory.clearCache()`:
   ```
       static WebDriver clearCache() {
           GLOBAL_CACHE.get { null }?.clear()
           PER_THREAD_CACHE.get { null }?.clear()
       }
   
       static WebDriver clearCacheAndQuitDriver() {
           def driver = clearCache()
           driver?.quit()
           driver
       }
   ```
   because the cache used `private final Cache<WebDriver> cache` is either from 
`GLOBAL_CACHE` or from `PER_THREAD_CACHE`. The new implementation of `static 
WebDriver clearCache()` is conceptually incorrect here and probably did not 
take into account that the cached value is returned and used further for the 
`driver?.quit()` call. 
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to