[vim/vim] Some test_mksession tests do not cleanup all the state (PR #20691)

0 views
Skip to first unread message

Illia Bobyr

unread,
Jul 2, 2026, 7:50:10 PM (4 hours ago) Jul 2
to vim/vim, Subscribed

Problem: Some test_mksession tests do not cleanup all the state
Solution: Add commands to clean up state introduced by the test

Before this change the following 4 tests were failing when executed individually:

Test_mksession_arglocal_localdir
Test_mksession_buffer_count
Test_mksession_one_buffer_two_windows
Test_mksession_winminheight

As in

  TEST_FILTER=winminheight make test_mksession

Yet, when ran as part of the whole test suite they succeeded.

This was due to some state leaking from one test into another.

I think this is bad, as it can confuse someone making changes in the relevant area.

Test_mksession_winminheight is actually still broken a bit, and requires winheight and winwidth set at the beginning of the test, rather than later, when it actually matters. This exposes a subtle bug in the session restore script. I have a patch in a separate commit.


Reviewer note.

Not sure if the change in Test_mksession_localmappings() is justified.
The minimum change would be to just add set sessionoptions& at the end.
But a try/finally block makes sure that a failure would not prevent the cleanup from happening.
I do not know if this is an issue in the first place.
I can see that try/finally is used in the test, but not a lot.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20691

Commit Summary

  • f21d6e7 Some test_mksession tests do not cleanup all the state

File Changes

(1 file)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20691@github.com>

Reply all
Reply to author
Forward
0 new messages