Commit Graph

13 Commits

Author SHA1 Message Date
Daniel Martí
98d4b0de6e pool: error quickly if we find a port in use
Before the fix, the added test would give a Pool.Allocate error like:

	pool could not connect to 9000: timeout waiting for initial target

The actual underlying error, which can only be seen if one inspects
chrome's stderr, is that it failed to bind to the debugging protocol
port if it was already in use.

This is of course an issue with the environment that chromedp is being
run under, since it was given a port range that wasn't available.
However, the confusing error can lead to developers wasting their time
instead of spotting the error quickly.

Unfortunately, there doesn't seem to be a way to have Chrome exit
immediately if it can't bind to the given port. So, instead of relying
on it, check if the current process can bind to the port first.

Add a test too, where we grab the first port in the pool range, and
check that we get an error that's not confusing.

Fixes #253.
2018-12-01 11:54:16 +00:00
Kenneth Shaw
622c90c82c Cleaning up runner API prior to package rewrite 2018-07-13 10:57:20 +07:00
Kenneth Shaw
1e1a3ace12 General code cleanup 2018-05-19 05:06:19 +07:00
Kenneth Shaw
b0c2445e67 Splitting repositories 2017-12-28 11:17:14 +07:00
Daniel Martí
335d22d376 all: simplify some error variables
There's no need to put the error variables in a larger scope, nor define
them earlier than necessary. If anything, it makes the code harder to
follow, such as figuring out when nil errors are returned.
2017-12-18 10:51:37 +07:00
Kenneth Shaw
148e24a615 Fixing issues with unit tests
1. Changes travis configuration to use the chrome addon
2. Adds more command line options to runner package
3. Removes grab-headless_shell.sh script
4. Cleans up and adds some environment variables for controlling how
   unit tests are ran
5. Fixes a minor issue in chromedp-gen on comment output (for working
   with latest protocol definition)
2017-12-18 07:11:42 +07:00
Kenneth Shaw
efc98098b4 Fixing panic on Pool.Release 2017-02-22 15:27:38 +07:00
Kenneth Shaw
dc17e7f8cd Parallelizing unit tests 2017-02-18 13:12:21 +07:00
Kenneth Shaw
21d13b8f0a Fixing missing wait call for pool chrome instances 2017-02-18 09:49:41 +07:00
Kenneth Shaw
7326b390a0 Initial changes to provide configurable logging options 2017-02-13 16:00:39 +07:00
Kenneth Shaw
3673164aef Code cleanup
- Refactored API calls to be cleaner
- Changed types that shoudn't be exported to not-exported
- Updated examples with API changes
- Added unit test for Title action
2017-02-12 14:08:40 +07:00
Kenneth Shaw
f73c429109 Renaming FrameHandler, updating to latest protocol.json, and code fixes 2017-02-12 12:50:46 +07:00
Kenneth Shaw
42c6cca7ed Initial commit of pool and unit tests 2017-02-09 22:01:40 +07:00