Allow defers to run in TestMain in federation API tests

This commit is contained in:
Neil Alexander 2022-05-23 14:54:43 +01:00
parent 028963af1c
commit b5a497a0c0
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -55,6 +55,7 @@ var servers = map[string]*server{
func TestMain(m *testing.M) {
// Set up the server key API for each "server" that we
// will use in our tests.
os.Exit(func() int {
for _, s := range servers {
// Generate a new key.
_, testPriv, err := ed25519.GenerateKey(nil)
@ -108,7 +109,8 @@ func TestMain(m *testing.M) {
// Now that we have built our server key APIs, start the
// rest of the tests.
os.Exit(m.Run())
return m.Run()
}())
}
type MockRoundTripper struct{}