From f5e7388bfe9c576e2db324221c412eebe3349621 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 11 Oct 2017 13:05:05 +0200 Subject: [PATCH] Improve YAML deadline warning See #2777 --- qutebrowser/utils/utils.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/qutebrowser/utils/utils.py b/qutebrowser/utils/utils.py index 92de4be5d..d8e63af1a 100644 --- a/qutebrowser/utils/utils.py +++ b/qutebrowser/utils/utils.py @@ -882,15 +882,18 @@ def yaml_load(f): end = datetime.datetime.now() delta = (end - start).total_seconds() - deadline = 3 if 'CI' in os.environ else 0.5 - if delta > deadline: - log.misc.error( - "YAML load took {}s\n" - "version: {}\n" - "C extension: {}\n\n" + deadline = 3 if 'CI' in os.environ else 1 + if delta > deadline: # pragma: no cover + log.misc.warning( + "YAML load took unusually long, please report this at " + "https://github.com/qutebrowser/qutebrowser/issues/2777\n" + "duration: {}s\n" + "PyYAML version: {}\n" + "C extension: {}\n" + "Stack:\n\n" "{}".format( delta, yaml.__version__, YAML_C_EXT, - '\n'.join(traceback.format_stack()))) + ''.join(traceback.format_stack()))) return data