mirror of
https://github.com/matrix-org/dendrite
synced 2024-12-14 19:23:52 +01:00
Allow defers to run in TestMain
in federation API tests
This commit is contained in:
parent
028963af1c
commit
b5a497a0c0
1 changed files with 54 additions and 52 deletions
|
@ -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