# fix display map tests · gitcafe/zed

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

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

Visibility: public

Requested revision: 0f7fc8c1a03eaec347df101ada66f28aefa3162a

Requested commit: 0f7fc8c1a03eaec347df101ada66f28aefa3162a

Commit: 0f7fc8c1a03eaec347df101ada66f28aefa3162a

Tree: 3dd0b09c30753371c1afc4c81482487a09d7f2bf

Author: Piotr Osiewicz

Committer: Piotr Osiewicz

## Message

```
fix display map tests

These tests failed due to an indefinite hang in buffer.condition in the following code:
\`\`\`rust
    let buffer = cx
        .add_model(|cx| Buffer::new(0, cx.model_id() as u64, text).with_language(language, cx));
    buffer.condition(cx, |buf, _| !buf.is_parsing()).await;
`\`\`
In both gpui1 and gpui2 \`.with_language\` spawns a task that notifies the context once it's done. The \`condition\` waits for notifications to be raised. The gist of the problem was that in gpui2, the spawned task was scheduled straight away, so we never really saw the notification with \`condition\`, causing us to wait indefinitely. This is probably a difference in test between schedulers in gpui1 and gpui2, but I kind of sidestepped the issue by spawning a condition before firing off a parsing task with \`set_language\`.

```

## Parents

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

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