-
Notifications
You must be signed in to change notification settings - Fork 115
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
Test running takes increasingly long after a context has finished #452
Comments
In your before you |
Almost, in our Just in case it happened to be the ChromeDriver, I've just re-run with Firefox and the GeckoDriver. That suffers from the exact same problem. More edits. :-) The moment the browser does close, the next context fires up very quickly. It's just the closing the browser that's taking a long time. |
Yes closing a browser does take a long time. If its getting slower to close each time that may be a problem I can address. I will make a project to try to repro tomorrow and work through it. |
Great, thanks for having a look into it. `module Test open canopy.classic let tests () = context "Tests" before (fun _ -> after (fun _ -> many 30 (fun _ -> The only difference here is that the browser is opened and closed in Also a side note, I hadn't noticed previously but this test does make it very obvious, the last test is only marked as successful after the browser has closed, rather than when I would expect, which is before Update: lol, that's 5 times I've tried reformatting the code to look like code. Maybe some VS formatting confusing things. I'm sure you can see what's going on. ;-) |
And the same thing is occurring on my home laptop, so it doesn't appear to be machine specific. I've attached my project, should you want to take a look. |
Hello, Cheers, Mike |
Mike, Sorry I forgot to look into this. If its an issue with webdriver, make sure yours is up to date with the latest version of chrome. If it is, you may try a few previous versions in case its a recently introduced issue. I generally just re-use the same browser throughout my tests runs because starting them is slow too. |
Hello again, Two things now. I'm going to update the tests we have to avoid closing the browser every time, mainly because that probably is a better way for the project to behave, and we also found the problem. The Quit function in canopy.fs (ln 275) isn't cleaning up the list of browsers it has opened. We're not too familiar with F# so we won't be sending you a crude PR, but by removing the current browser from the browsers list, restarting a browser instance was consistently fast every time. Hope that helps, and thanks for your time. Mike |
Hi,
I've noticed something strange, but maybe this is the way we're structuring our tests. In order to ensure a clean slate every time, each of our test contexts creates a new browser, then closes it at the end. I've noticed that as we build up the number of tests, the step of closing the browser and carrying on to the next context takes increasing amounts of time as the test run continues.
At the very beginning, the step is almost instant. It seems like with every new context that is executed, this step takes a second longer than the one before.
I've tried with the LiveHtmlReporter and the ConsolerReporter, both behave the same.
It also does the same whether I'm running debug mode in Visual Studio or straight from a command prompt.
Any advice or suggestions would be appreciated.
Cheers,
Mike
The text was updated successfully, but these errors were encountered: