def test_serial_call_response_times(self): load_yaml_config() self.assertEqual(1, len(trace_urls)) total_sleep_time = int(get_total_sleep_time() * 1000) server_process = Process(target=start_server) server_process.start() req_url = "http://%s:%s%s" % (HOST, VARNISH_PORT, trace_urls[0]) requests.get(req_url) server_process.join(timeout=1) server_process.terminate() max = get_timestamp("DESC") min = get_timestamp("ASC") delta = (max - min) / 1000 self.assertAlmostEqual(delta, total_sleep_time, delta=100)
def testSerialCallResponseTimes(self): load_yaml_config() self.assertEqual(1, len(trace_urls)) total_sleep_time = int(get_total_sleep_time() * 1000) server_process = Process(target=start_test_server) server_process.start() req_url = "http://%s:%s%s" % (HOST, VARNISH_PORT, trace_urls[0]) requests.get(req_url) server_process.join(timeout=1) server_process.terminate() max = get_max_timestamp() min = get_min_timestamp() delta = (max - min) / 1000 self.assertAlmostEqual(delta, total_sleep_time, delta=50)
def setUpClass(cls): assert cls.server_process load_yaml_config() cls.server_process.daemon = True cls.server_process.start()