-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
feat: instance "name", test ids, store pipes in stdpath(state) #8519
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
Conversation
f8ddde8 to
74419b8
Compare
04b6e20 to
b08237a
Compare
25b61cb to
981e9a8
Compare
4e4362e to
ac4a5f8
Compare
e4acffe to
62e3211
Compare
Problem: 1. Log messages (especially in CI) are hard to correlate with tests. 2. Since b353a5c neovim#11886, dumplog() prints the logs next to test failures. This is noisy and gets in the way of the test results. Solution: 1. Associate an incrementing id with each test and include it in log messages. - FUTURE: add v:name so Nvim instances can be formally "named"? 2. Mention "child" in log messages if the current Nvim is a child (based on the presence of $NVIM). BEFORE: DBG … 12345 UI: event DBG … 12345 log_server_msg:722: RPC ->ch 1: … DBG … 12345 UI: flush DBG … 12345 inbuf_poll:444: blocking... events_enabled=1 events_pending=0 DBG … 23454 UI: stop INF … 23454 os_exit:594: Nvim exit: 0 AFTER: DBG … T57 UI: event DBG … T57 log_server_msg:722: RPC ->ch 1: … DBG … T57 UI: flush DBG … T57 inbuf_poll:444: blocking... events_enabled=1 events_pending=0 DBG … T57/child UI: stop INF … T57/child os_exit:594: Nvim exit: 0
Don't need to dumplog() on each failed test because we now have test-ids that associate log messages with tests.
Problem:
- Unix sockets are created in random /tmp dirs.
- /tmp is messy, unclear when OSes actually clear it.
- The generated paths are very ugly. This adds friction to reasoning
about which paths belong to which Nvim instances.
- No way to provide a human-friendly way to identify Nvim instances in
logs or server addresses.
Solution:
- Store unix sockets in stdpath('state')
- Allow --listen "name" and serverstart("name") to given a name (which
is appended to a generated path).
TODO:
- is stdpath(state) the right place?
| if failureCount > 0 or errorCount > 0 then | ||
| io.write(global_helpers.read_nvim_log(nil, true)) | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't it better to have this in either handler.testEnd() or handler.error()?
otherwise, I don't see much use of dumping the tail of the log. however, it would work if read_nvim_log() was grepping for test_id
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- We've tried testEnd() (that's the current state of
master). It is too noisy. This PR intentionally avoids that. - The tail should be short because most tests don't log (CI sets loglevel=WARN)
- The logs in theory may be useful because of the test ids. The next step is to use this on master for awhile and see how useful it is or isn't.
if
read_nvim_log()was grepping fortest_id
That could be interesting. At this point the idea is just to see if it's useful at all, and then improve things if and only if need becomes clear.
|
Merging this but will continue iterating. Especially interested in strong arguments against storing sockets / named pipes in
This would be a complication, but if we touch it periodically the socket won't be removed. #17093 (comment)
That might be an advantage of XDG_RUNTIME_DIR, if it implies that XDG_STATE_DIR is potentially non-local. |
For the record, |
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('runtime'), and store sockets there. - Establish "/tmp/nvim.user/" as the root of all Nvim temp dirs. closes neovim#3517 closes neovim#17093
I would not put runtime files like sockets & named pipes into anything beneach
From my understanding
The standard explicitly suggests to implement a fallback to |
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('runtime'), and store sockets there. - Establish "/tmp/nvim.user/" as the root of all Nvim temp dirs. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('runtime'), and store sockets there. - Establish "/tmp/nvim.user/" as the root of all Nvim temp dirs. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('runtime'), and store sockets there. - Establish "/tmp/nvim.user/" as the root of all Nvim temp dirs. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('runtime'), and store sockets there. - Establish "/tmp/nvim.user/" as the root of all Nvim temp dirs. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('runtime'), and store sockets there. - Establish "/tmp/nvim.user/" as the root of all Nvim temp dirs. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('runtime'), and store sockets there. - Establish "/tmp/nvim.user/" as the root of all Nvim temp dirs. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('runtime'), and store sockets there. - Establish "/tmp/nvim.user/" as the root of all Nvim temp dirs. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('run') ($XDG_RUNTIME_DIR), store sockets there. - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Introduce stdpath('run') ($XDG_RUNTIME_DIR), store sockets there. - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem: - Since c57f6b2 #8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes #3517 closes #17093
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Since neovim/neovim#8519, `NVIM_LISTEN_ADDRESS` is only directly used when it contains colons or (back-)slashes. Otherwise it is concatanated with PID suffix as tempdir prefix.
Since neovim/neovim#8519, `NVIM_LISTEN_ADDRESS` is only directly used when it contains colons or (back-)slashes. Otherwise it is concatanated with a tempdir prefix and suffixes to form the final path.
Problem: - Since c57f6b2 neovim#8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes neovim#3517 closes neovim#17093
Problem:
Solution:
Details
Each test gets a test id which looks like "T123". This also appears in the log file. Child processes spawned from a test appear in the logs with the parent name followed by "/c". Example:
TODO:
~/.local/state/.