New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests which access the X selections hang if something is asserting ownership #4900
Comments
IMO the tests should not change the user clipboards at all (no "save, change and then restore" does not work in general), unless maybe some env flag that could be set in travis and qb where we have control over it. |
At least one of those tests (viml_system_spec.lua) is explicitly testing handling of child processes with a specific behavior (exhibited by xclip). Maybe a simple test program that exhibits the same behavior would be a better solution there. |
Here is a snippet: #4798 (comment) |
I'm not sure the sleep is as relevant for this scenario is just having the child process not explicitly close its stdout/stderr handles. |
Can this be closed? |
I don't think so. The viml_system_spec test is still using xclip, which may encounter this issue. Even if that wasn't a problem, I think having a small test program that exhibits the problem is better than relying on the environment having xclip installed, since it ensures we're testing the problem consistently and doesn't mess with the user's environment. |
Fixed by #4798 |
This shouldn't have been closed. There's still a test that's invoking xclip, which both messes with the user's selection and prevents the tests from exiting. |
We could wrap that test in a timeout |
The test itself completes. The test runner doesn't, because xclip is still running. For example, the last test run I did has been sitting here for the past 12 hours:
Killing xclip lets it clean up. |
This reverts commit eb40b7e. The change caused this error on QuickBuild: INFO - # test/functional/core/job_spec.lua @ 668: pty process teardown does not prevent/delay exit. #4798 #4900 INFO - not ok 321 - pty process teardown does not prevent/delay exit. #4798 #4900 INFO - # test/functional/core/job_spec.lua @ 668 INFO - # Failure message: ./test/functional/ui/screen.lua:302: Row 1 did not match. INFO - # Expected: INFO - # |* | INFO - # |[Process exited 0] | INFO - # | | INFO - # | | INFO - # | | INFO - # |-- TERMINAL -- | INFO - # Actual: INFO - # |*E575: Error while reading ShaD| INFO - # |a file: mark entry at position| INFO - # | 92 has invalid line number | INFO - # |Press ENTER or type command to| INFO - # | continue | INFO - # |-- TERMINAL -- | INFO - # INFO - # To print the expect() call that would assert the current screen state, use INFO - # screen:snaphot_util(). In case of non-deterministic failures, use INFO - # screen:redraw_debug() to show all intermediate screen states. INFO - # stack traceback: INFO - # ./test/functional/ui/screen.lua:302: in function 'wait' INFO - # ./test/functional/ui/screen.lua:216: in function 'expect' INFO - # test/functional/core/job_spec.lua:677: in function <test/functional/core/job_spec.lua:668>
This reverts commit d0673ea. Testing whether unsetting shada caused the following error in Appveyor [00:11:35] [ ERROR ] 1 error, listed below: [00:11:35] [ ERROR ] C:/projects/neovim/test/functional\core\job_spec.lua @ 661: pty process teardown does not prevent/delay exit. neovim#4798 neovim#4900 [00:11:35] .\test\functional\ui\screen.lua:302: Row 1 did not match. [00:11:35] Expected: [00:11:35] |* | [00:11:35] | | [00:11:35] | | [00:11:35] | | [00:11:35] |^[Process exited 0] | [00:11:35] | | [00:11:35] Actual: [00:11:35] |*dir\api\buffer.c.gcda:Data fil| [00:11:35] |e mismatch - some data files m| [00:11:35] |ay have been concurrently upda| [00:11:35] |t | [00:11:35] |^[Process exited -1073741819] | [00:11:35] | | [00:11:35] [00:11:35] To print the expect() call that would assert the current screen state, use [00:11:35] screen:snapshot_util(). In case of non-deterministic failures, use [00:11:35] screen:redraw_debug() to show all intermediate screen states. [00:11:35] [00:11:35] stack traceback: [00:11:35] .\test\functional\ui\screen.lua:302: in function 'wait' [00:11:35] .\test\functional\ui\screen.lua:216: in function 'expect' [00:11:35] C:/projects/neovim/test/functional\core\job_spec.lua:672: in function <C:/projects/neovim/test/functional\core\job_spec.lua:661>
I agree that we should have a specialized program to test the behavior, and not messing with the clipboard data (#4900 (comment)). I came here, since the fix / workaround here (
|
Replaces "xclip" with a dedicated helper program. Fixes: neovim#4900 (comment)
* tests: move os_kill to functional helpers * tests: fix system_spec when run with clipboard manager Replaces "xclip" with a dedicated helper program. Fixes: #4900 (comment)
nvim --version
: HEADActual behaviour
If a program is currently asserting ownership of an X selection used by a test, the test will hang due to xsel/xclip not exiting.
Expected behaviour
The test completes successfully, regardless of whether the selection is asserted when the test runs.
Steps to reproduce using
nvim -u NORC
I ran into this while investigating the QB test failures for #4841, although I'm not entirely sure that it's related since I wouldn't expect any selections to be asserted there.
The text was updated successfully, but these errors were encountered: