From 7c33ff4046c6566038bb61d7007291b2d1538d3b Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Wed, 24 Jan 2018 07:40:34 -0500 Subject: [PATCH] Fix flaky editor test. Give the process time to write its PID before trying to interrupt it. --- tests/end2end/features/test_editor_bdd.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/end2end/features/test_editor_bdd.py b/tests/end2end/features/test_editor_bdd.py index 18551271b..e2415da46 100644 --- a/tests/end2end/features/test_editor_bdd.py +++ b/tests/end2end/features/test_editor_bdd.py @@ -22,6 +22,7 @@ import json import textwrap import os import signal +import time import pytest_bdd as bdd bdd.scenarios('editor.feature') @@ -115,6 +116,11 @@ def kill_editor_wait(tmpdir): def save_editor_wait(tmpdir): """Trigger the waiting editor to write without exiting.""" pidfile = tmpdir / 'editor_pid' + # give the "editor" process time to write its pid + for _ in range(10): + if pidfile.check(): + break + time.sleep(1) pid = int(pidfile.read()) # windows has no SIGUSR2, but we don't run this on windows anyways # for posix, there IS a member so we need to ignore useless-suppression