Attempt to solve flaky editor tests.
These are passing locally but failing in travis. This fixes two possible timing issues: - Ensure the signals are set up befor the pidfile is written. The function that sends the signal waits for the pidfile to exist, so this ensures we don't miss a signal. - Wait for the log message indicating that the editor file was read back, so the test doesn't run through before we get a chance to read from the editor.
This commit is contained in:
parent
eab9b70f28
commit
0aefffce4d
@ -138,6 +138,7 @@ Feature: Opening external editors
|
|||||||
And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log
|
And I wait for "Entering mode KeyMode.insert (reason: clicking input)" in the log
|
||||||
And I run :open-editor
|
And I run :open-editor
|
||||||
And I save without exiting the editor
|
And I save without exiting the editor
|
||||||
|
And I wait for "Read back: foobar" in the log
|
||||||
And I run :click-element id qute-button
|
And I run :click-element id qute-button
|
||||||
Then the javascript message "text: foobar" should be logged
|
Then the javascript message "text: foobar" should be logged
|
||||||
|
|
||||||
|
@ -90,11 +90,12 @@ def set_up_editor_wait(quteproc, tmpdir, text):
|
|||||||
if sig == signal.SIGUSR1:
|
if sig == signal.SIGUSR1:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
|
signal.signal(signal.SIGUSR1, handle)
|
||||||
|
signal.signal(signal.SIGUSR2, handle)
|
||||||
|
|
||||||
with open(r'{pidfile}', 'w') as f:
|
with open(r'{pidfile}', 'w') as f:
|
||||||
f.write(str(os.getpid()))
|
f.write(str(os.getpid()))
|
||||||
|
|
||||||
signal.signal(signal.SIGUSR1, handle)
|
|
||||||
signal.signal(signal.SIGUSR2, handle)
|
|
||||||
time.sleep(100)
|
time.sleep(100)
|
||||||
""".format(pidfile=pidfile, text=text)))
|
""".format(pidfile=pidfile, text=text)))
|
||||||
editor = json.dumps([sys.executable, str(script), '{}'])
|
editor = json.dumps([sys.executable, str(script), '{}'])
|
||||||
|
Loading…
Reference in New Issue
Block a user