# Add \`seed\` argument to \`\#\[gpui::test\]\` attribute macro \(\#26764\) · gitcafe/zed

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

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

Visibility: public

Requested revision: f587e95a7e0de31f818c7f5b45f50ebb1b6ec914

Requested commit: f587e95a7e0de31f818c7f5b45f50ebb1b6ec914

Commit: f587e95a7e0de31f818c7f5b45f50ebb1b6ec914

Tree: 4424c3045bb75ad801fe224d28be7b37251c774d

Author: João Marcos

Committer: GitHub

## Message

```
Add `seed` argument to `#[gpui::test]` attribute macro (#26764)

This PR introduces the arguments `seed` and `seeds` to `gpui::test`,
e.g.:
- `#[gpui::test(seed = 10)]`
- `#[gpui::test(seeds(10, 20, 30, 40))]`

Which allows us to run a test against a specific seed value without
slowing
down our tests like `iterations` does with high values.

This was motivated by a diff hunk test that only fails in a 400+ seed,
but is
slow to run 400+ times for every `cargo test`.

If your test failed with a specific seed, you can now add the `seed` arg
to
increase the chances of detecting a regression.

There are now three ways of setting seeds, the `SEED` env var,
`iterations`,
and the args this PR adds. See docs in `gpui::test`.

---

I also relaxed the limitation on `retries` not working with
`iterations`, as
that seemed unnecessary.

Release Notes:

- N/A
```

## Parents

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

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