From 4ac61d6c21df39b26d0fabe3fa0c1a1f08f040ef Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Mon, 5 Oct 2026 13:55:37 +0200 Subject: [PATCH] Set the caption of an integration test on the UI thread An integration test sets its caption in the options view from the test's own goroutine, while the UI thread may be drawing that view. The race detector reports this now and then, and fails whichever test happens to be running. Set the caption on the UI thread instead. Co-Authored-By: Claude Opus 5.5 (1M context) --- pkg/gui/gui_driver.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/gui/gui_driver.go b/pkg/gui/gui_driver.go index af261b453..5db3d9d92 100644 --- a/pkg/gui/gui_driver.go +++ b/pkg/gui/gui_driver.go @@ -266,12 +266,12 @@ func (self *GuiDriver) TopViewInWindow(windowName string) *gocui.View { } func (self *GuiDriver) SetCaption(caption string) { - self.gui.setCaption(caption) + self.OnUIThreadAndWait(func() { self.gui.setCaption(caption) }) self.waitTillIdle() } func (self *GuiDriver) SetCaptionPrefix(prefix string) { - self.gui.setCaptionPrefix(prefix) + self.OnUIThreadAndWait(func() { self.gui.setCaptionPrefix(prefix) }) self.waitTillIdle() }