From f3e270b796ecf6de182ab1149e55fa91de5b1abd Mon Sep 17 00:00:00 2001 From: Noah Levitt Date: Tue, 20 Feb 2018 14:54:58 -0800 Subject: [PATCH] make test_method_filter() pass by waiting in test_limit_large_resource() for url processing to finish, to prevent stats from affecting the subsequent test --- setup.py | 2 +- tests/test_warcprox.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 66e8a07..31ee69f 100755 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ except: setuptools.setup( name='warcprox', - version='2.4b2.dev149', + version='2.4b2.dev150', description='WARC writing MITM HTTP/S proxy', url='https://github.com/internetarchive/warcprox', author='Noah Levitt', diff --git a/tests/test_warcprox.py b/tests/test_warcprox.py index 7185255..f054d69 100755 --- a/tests/test_warcprox.py +++ b/tests/test_warcprox.py @@ -1224,11 +1224,17 @@ def test_limit_large_resource(archiving_proxies, http_daemon, warcprox_): soon as it passes the 200000 limit. As warcprox read() chunk size is 65536, the expected result size is 65536*4=262144. """ + urls_before = warcprox_.proxy.running_stats.urls + url = 'http://localhost:%s/300k-content' % http_daemon.server_port response = requests.get( url, proxies=archiving_proxies, verify=False, timeout=10) assert len(response.content) == 262144 + # wait for processing of this url to finish so that it doesn't interfere + # with subsequent tests + wait(lambda: warcprox_.proxy.running_stats.urls - urls_before == 1) + def test_method_filter( warcprox_, https_daemon, http_daemon, archiving_proxies, playback_proxies):