Subject: bug#79056: tab-bar-tests-quit-restore-window sometimes fails in *compilation* buffer

From: Paul Eggert <[email-masked]>
Date: Sun, 20 Jul 2025 17:07:08 -0700

On 2025-07-19 23:56, Juri Linkov wrote:
> Maybe tuning frame parameters would help here:
> 
>    (let* ((frame-params (when noninteractive
>                           '((window-system . nil)
>                             (tty-type . "linux"))))
> 
> I tried different tty-type values such as "ansi", "dumb", "vt100", "xterm"
> with different effects.

I don't know what the test is trying to do, but when it's noninteractive 
why does the test access /dev/tty or need TERM? /dev/tty and TERM 
ordinarily ought to be irrelevant and unused in a noninteractive test.

How about something like the following patch?

diff --git a/test/lisp/tab-bar-tests.el b/test/lisp/tab-bar-tests.el
index 257f6bd37d3..9529f43853b 100644
--- a/test/lisp/tab-bar-tests.el
+++ b/test/lisp/tab-bar-tests.el
@@ -52,15 +52,7 @@ tab-bar-tests-close-other-tabs-with-arg
    (tab-bar-tabs-set nil))

  (ert-deftest tab-bar-tests-quit-restore-window ()
-  (skip-when (pcase system-type
-               ;; Skip test on MS-Windows in batch mode, since terminal
-               ;; frames cannot be created in that case.
-               ('windows-nt noninteractive)
-               ;; Emba runs the container without "--tty"
-               ;; (the environment variable "TERM" is nil), and this
-               ;; test fails with '(error "Could not open file: 
/dev/tty")'.
-               ;; Therefore skip it unless it can use '(tty-type . 
"linux")'.
-               ('gnu/linux (null (getenv "TERM")))))
+  (skip-when (or noninteractive (null (getenv "TERM"))))

    (let* ((frame-params (when noninteractive
                           '((window-system . nil)