- Notifications
You must be signed in to change notification settings - Fork1k
chore: add broker for test databases#19791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
spikecurtis commentedSep 12, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This stack of pull requests is managed byGraphite. Learn more aboutstacking. |
89fca3f
toef3db0e
Comparefunc NewClient() (client *Client, err error) { | ||
client = &Client{ | ||
cmd: exec.Command("go", "run", "github.com/coder/coder/v2/cmd/dbtestbroker"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This breaks if you are outside the directory tree of the repo, but I think that's pretty rare.
Still, in the PR above this on the stack I had to move some code around in templatepull_test.go
0758e24
toa7e3c5d
Comparea7e3c5d
to9191ef7
Compareclosing in favor of stack at#19844 |
Uh oh!
There was an error while loading.Please reload this page.
Adds a new test database broker, that runs in a subprocess, to clone test databases.
relates tocoder/internal#927
Moving to a subprocess allows us to still clean up the test databases if the main test process dies (panics, times out, or is killed). We communicate with the subprocess over dRPC over yamux over stdio. When the main test process dies, the stdin pipe is closed, which triggers the broker to clean up any databases it cloned that were not explicitly discarded.