# fix local collab tests \(\#4209\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 5a9f1e4eb784db574b060f3c93e9e5deca025b51

Requested commit: 5a9f1e4eb784db574b060f3c93e9e5deca025b51

Commit: 5a9f1e4eb784db574b060f3c93e9e5deca025b51

Tree: 0596d1361b6fde3aac992a901ce857c0ddfdea27

Author: Conrad Irwin

Committer: GitHub

## Message

```
fix local collab tests (#4209)

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 (and an unrelated retain cycle in the
UserStore) fixes the problem (though does make me
wonder if a different approach might be preferrable).

Release Notes:

- N/A
```

## Parents

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

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

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