Subject: Re: bug#58877: 29.0.50; [PATCH] When killing Emacs from a client frame with no other frames, Emacs shows a useless error prompt

From: Eli Zaretskii <[email-masked]>
Date: Sat, 26 Nov 2022 16:43:57 +0200

> Date: Fri, 25 Nov 2022 12:57:37 -0800
> Cc: [email-masked]
> From: Jim Porter <[email-masked]>
> 
> >> Hm, it looks like the emacsclient may not be starting up correctly.
> >> Could you try the attached patch? I doubt this will fix the tests, but
> >> hopefully you'll get some more-useful error messages.
> > 
> > Here are the failure info from each failed test after this patch:
> > 
> > Test server-tests/emacsclient/create-frame condition:
> >      Output:
> >      (ert-test-failed "timed out waiting for (or (= (length server-clients) (1+ starting-client-count)) (eq (process-status emacsclient) exit-status)) to be non-nil")
> >     FAILED  1/7  server-tests/emacsclient/create-frame (5.062500 sec) at lisp/server-tests.el:138
> 
> Oops, sorry about that. I didn't realize until now that 'ert-info' 
> computes its message immediately, rather than at the time of printing 
> the info.[1] I've added a bit of code to ert.el to support this case, 
> which will hopefully produce better output.

Never mind, I think I know what's the cause of the problem: I have my
production session of Emacs running on the system ,and it already has the
server started.  So a plain call to server-start fails.

I think you need to modify the tests to ensure the server file is created in
a temporary directory.  And keep in mind that the variable which affects
that is different depending on whether server-use-tcp is or isn't non-nil.