Closed nddipiazza closed 6 years ago
Thanks for this. I think instead of following the page load timeout that page cancellations should either have their own configurable timeout, use one of the script-related timeouts, or just use some value probably good enough such as 3 seconds.
I'd just want to make sure that when the timeout is reached that JavaFX actually cancels the event and it doesn't stick around taking up resources. If it still isn't really canceled then this whole approach might need some rethinking.
Again, thanks for this and the associated bug report #292.
@hollingsworthd any word on this fix? I am probably going to use my PR here in my next release unless you are going to post a PR of this soon.
@nddipiazza sorry I've been indisposed. Not able to merge PR's etc at the moment. I've been interested in getting more contributors access to merge PR's and make releases. Once I'm able to would like to add you as contributor but currently I'm not sure when I can do that.
Looks good. I think this is the appropriate way to fix this. Thanks very much for contributing this and for your patience waiting!
This is released as v0.17.11 available via Maven Central
tl;dr
DO NOT MERGE this still needs work.
In
com.machinepublishers.jbrowserdriver.JBrowserDriverServer#get
in the finally block where it is going to wait for a status code, the AppThread.exec method needs to use some sort of timeout. Otherwise it will wait upwards of 10000ms in the sample program below, even though the user is expecting a 2000ms timeout.In this PR, I use the pageLoadTimeoutMS as a timeout parameter call which is better than nothing.
To verify
Expected: Timeout should not be 10000ms, it should be closer to the page timeout.
NOTE: This still needs work. In this state it is waiting
2*pageTimeout
If I replace
https://github.com/MachinePublishers/jBrowserDriver/pull/291/files#diff-048530290a10b616323dcd32f8c164e1R340
with
}, 500);
it will be much closer to the actual timeout. What would be the side effect of doing this?