MCPcopy Create free account
hub / github.com/apache/impala / open_debug_webpage

Method open_debug_webpage

tests/common/impala_service.py:64–83  ·  view source on GitHub ↗
(self, page_name, timeout=10, interval=1)

Source from the content-addressed store, hash-verified

62 self.webserver_username_password = (WEBSERVER_USERNAME, WEBSERVER_PASSWORD)
63
64 def open_debug_webpage(self, page_name, timeout=10, interval=1):
65 start_time = time()
66
67 while (time() - start_time < timeout):
68 try:
69 protocol = "http"
70 if self.webserver_certificate_file != "":
71 protocol = "https"
72 host_port = to_host_port(self.webserver_interface, self.webserver_port)
73 url = "%s://%s/%s" % (protocol, host_port, page_name)
74 cert = self.webserver_certificate_file
75 # Instead of cert use its CA cert if available.
76 file_part = cert.split("/")[-1]
77 if file_part in CERT_TO_CA_MAP:
78 cert = cert.replace(file_part, CERT_TO_CA_MAP[file_part])
79 return requests.get(url, verify=cert, auth=self.webserver_username_password)
80 except Exception as e:
81 LOG.info("Debug webpage not yet available: %s", str(e))
82 sleep(interval)
83 assert 0, 'Debug webpage did not become available in expected time.'
84
85 def read_debug_webpage(self, page_name, timeout=10, interval=1):
86 return self.open_debug_webpage(page_name, timeout=timeout, interval=interval).text

Callers 3

read_debug_webpageMethod · 0.95
wait_for_page_readyMethod · 0.95

Calls 3

to_host_portFunction · 0.90
timeFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected