mirror of
https://github.com/matrix-org/dendrite.git
synced 2024-11-26 08:11:55 -06:00
Allow defers to run in TestMain
in federation API tests
This commit is contained in:
parent
028963af1c
commit
b5a497a0c0
|
@ -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{}
|
||||
|
|
Loading…
Reference in a new issue