console: add cleanup to avoid leaks in newTester #27695 (#1539)

This commit is contained in:
Daniel Liu 2025-09-21 19:36:43 +08:00 committed by GitHub
parent 72b932acbf
commit 4ca4c854ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -111,6 +111,10 @@ func newTester(t *testing.T, confOverride func(*ethconfig.Config)) *tester {
t.Fatalf("failed to start test stack: %v", err)
}
client := stack.Attach()
t.Cleanup(func() {
client.Close()
})
prompter := &hookedPrompter{scheduler: make(chan string)}
printer := new(bytes.Buffer)