# test\(server\): wait on the registry change stream instead of spinning on the cache file · pingdotgg/t3code

[View on GitCafe](https://git.cafe/pingdotgg/t3code/commit/c27b2dc338289e71130f493ea461161e061543e3)

Repository: [pingdotgg/t3code](https://git.cafe/pingdotgg/t3code)

Visibility: public

Requested revision: c27b2dc338289e71130f493ea461161e061543e3

Requested commit: c27b2dc338289e71130f493ea461161e061543e3

Commit: c27b2dc338289e71130f493ea461161e061543e3

Tree: 866279ac7adfeafe588bb426864aff61d4d2d82f

Author: Julius Marminge

Committer: Julius Marminge

## Message

```
test(server): wait on the registry change stream instead of spinning on the cache file

Two ProviderRegistry tests polled the status-cache file up to 50 times after publishing a change, which lost the race on a loaded Windows runner and read the previous snapshot. The registry writes the cache and only then publishes, so subscribe to its change stream before publishing and join on the matching checkedAt; the file is on disk by then.

On Windows, readBootstrapEnvelope consumes the inherited descriptor through an auto-closing stream. The successful-read tests now leave that descriptor to the stream instead of racing it with a scoped second close; failure-path tests still close descriptors they retain.

Co-Authored-By: Claude Code <noreply@anthropic.com>

```

## Parents

- [de8410c3f37ff5d450a60d82e48ec67cad1d8a61](https://git.cafe/pingdotgg/t3code/commit/de8410c3f37ff5d450a60d82e48ec67cad1d8a61?format=markdown)

[Source at this commit](https://git.cafe/pingdotgg/t3code/tree/c27b2dc338289e71130f493ea461161e061543e3?format=markdown)
