# Fix randomized test failures by waiting for client_b to be added to worktree_a · gitcafe/zed

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

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

Visibility: public

Requested revision: a1412166f01a07ab85ee30a690fe3362952c4252

Requested commit: a1412166f01a07ab85ee30a690fe3362952c4252

Commit: a1412166f01a07ab85ee30a690fe3362952c4252

Tree: b091ce95394d7cce0576f69827062cd7bef33a54

Author: Nathan Sobo

Committer: Nathan Sobo

## Message

```
Fix randomized test failures by waiting for client_b to be added to worktree_a

We perform an async fetch of client_b's user data on worktree_a, which ends up holding a handle that prevents worktree_a from being released later in the test. By waiting for this fetch to finish before proceeding, we can be sure worktree_a actually gets released.

A more comprehensive fix would be some way to ensure we actually perform a release if an entity is fully dropped outside of an update cycle, but this fixes the issue for now.

Co-Authored-By: Max Brunsfeld <max@zed.dev>

```

## Parents

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

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