browserup / browserup-proxy

BrowserUp Proxy is a free utility to watch, test, and manipulate web application network traffic and performance.
https://browserup.com
Apache License 2.0
163 stars 42 forks source link

waitForQuiescence always times out #369

Open dkbarn opened 3 years ago

dkbarn commented 3 years ago

I am having trouble getting the /wait endpoint to behave as expected. No matter how short I set the quiet period, or how long I set the timeout, it always times out. For example, if I set quietPeriodInMs to 1 and timeoutInMs to 120000, it will take 120000 ms and timeout, even when there should be no traffic at all.

To Reproduce

  1. Start a browserup server. For me this looks like: /opt/browserup-proxy-2.1.2/bin/browserup-proxy --port 30050
  2. Add a proxy and start chromedriver using this proxy. I do this in Python, using these settings:
    
    proxy = Client("localhost:30050", params={"port": 30052, "trustAllServers": True})

chrome_options = Options() chrome_options.binary_location = "/opt/google/chrome/chrome" chrome_options.add_argument("disable-3d-apis") chrome_options.add_argument("disable-accelerated-video") chrome_options.add_argument("disable-background-mode") chrome_options.add_argument("disable-dev-shm-usage") chrome_options.add_argument("disable-extensions") chrome_options.add_argument("disable-gpu") chrome_options.add_argument("disable-notifications") chrome_options.add_argument("disable-plugins") chrome_options.add_argument("disable-preconnect") chrome_options.add_argument("disable-translate") chrome_options.add_argument("disable-preconnect") chrome_options.add_argument("disable-session-crashed-bubble") chrome_options.add_argument("ignore-certificate-errors") chrome_options.add_argument("no-experiments") chrome_options.add_argument("no-pings") chrome_options.add_argument("no-sandbox") chrome_options.add_argument("proxy-server=http://localhost:30052") chrome_options.add_argument("start-maximized") chrome_options.add_argument("headless")

driver = webdriver.Chrome("/opt/google/chromedriver", options=chrome_options)


3. Load a webpage: ```driver.get("https://www.google.com/")```
4. Wait for proxy traffic to stop: ```curl -X PUT http://localhost:30050/proxy/30052/wait?quietPeriodInMs=1&timeoutInMs=120000```
5. /wait will timeout.

**Expected behavior**
Calling PUT /wait with quietPeriodInMs=1 and timeoutInMs=120000 should return fairly immediately once a page finishes loading, since there should definitely be a quiet period of 1 millisecond in a 2 minute window.

**Please complete the following information:**
 - OS: Ubuntu 20.04
 - Browser: chromedriver 88.0.4324.96
 - Version: 2.1.2