# Fix leaking test contexts · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/0b1b758f0263e5a151eb2865b88a19c3bf8eef17)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 0b1b758f0263e5a151eb2865b88a19c3bf8eef17

Requested commit: 0b1b758f0263e5a151eb2865b88a19c3bf8eef17

Commit: 0b1b758f0263e5a151eb2865b88a19c3bf8eef17

Tree: 71ead6d6362dd275e1853aeaf3d71e7b33c2db82

Author: Conrad Irwin

Committer: Conrad Irwin

## Message

```
Fix leaking test contexts

I was unable to run the collab tests locally because I would run out of
file descriptors.

From some digging it turned out that tokio allocates a new file
descriptor to do work on the CurrentThread using KQUEUE.

We create a new tokio Runtime with each database connection, and these
database connections were being retained by the Client, which is
retained by the Context.

Cleaning up our leaked contexts fixes the problem (though does make me
wonder if a different approach might be preferrable).

```

## Parents

- [ba5b969e100a73f38ab387eb337fca59fbbcffe0](https://git.cafe/gitcafe/zed/commit/ba5b969e100a73f38ab387eb337fca59fbbcffe0?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/0b1b758f0263e5a151eb2865b88a19c3bf8eef17?format=markdown)
