Repository navigation
Reuse a fixed pool of channels in the live contract suite - #382
Merged
Merged
Conversation
GraemeF
marked this pull request as ready for review
October 22, 2026 18:26
The live contract suite created a channel per seeded name per test and never removed it, so every run left dozens of channels in the realm. The minter creates each one and so administers it. The per-test dispose now archives what the test seeded, which runs whether the test passed or failed. A start-of-suite sweep archives the channels of earlier runs more than an hour old, which covers a run killed before its dispose ran.
The sweep shares the minter with every other live client, so a large backlog of leftover channels must not burst against the realm's rate limit.
Zulip cannot delete a channel, and an archived one still loads in every web client. The suite now seeds each channel name into one fixed channel per realm and empties it before use by moving its topics into a spent channel, so a run adds no channels whether it passes or fails.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The live contract suite created a fresh channel for each seeded name in each test. Zulip cannot delete a channel, and an archived channel still loads in every web client, so each run grew the realm for good.
The suite now keeps one channel per seeded name,
cc-ct-<name>, and reuses it in every run. Before a test uses one, the minter empties it:cc-ct-spentchannel, without notices. The minter may do this because it created the pool channels, and the realm makes a channel's creator its administrator.A run therefore leaves the realm's channel count unchanged, whether it passes, fails or is killed. The first run against a realm creates the pool.
Two runs at once against the same realm would empty each other's channels. A comment marks that limit.
Only the live suite changes. The default
bun run checkdoes not run it.