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) <noreply@anthropic.com>
This commit is contained in:
Stefan Haller
2026-10-05 13:55:37 +02:00
co-authored by Claude Opus 5.5
parent b8a7dc7d3c
commit 4ac61d6c21
+2 -2
View File
@@ -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()
}