Skip to content

Reuse a fixed pool of channels in the live contract suite - #382

Merged
GraemeF merged 3 commits into
mainfrom
comms-3mpxj
Oct 23, 2026
Merged

GraemeF merged 3 commits into
mainfrom
comms-3mpxj

Conversation

@GraemeF

@GraemeF GraemeF commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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:

  • It clears the channel's description first, because a description change posts a notice into the channel.
  • It moves each topic into a cc-ct-spent channel, 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 check does not run it.

@GraemeF
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.
@GraemeF GraemeF changed the title Archive the live contract suite's test channels after each test Reuse a fixed pool of channels in the live contract suite Oct 23, 2026
@GraemeF
GraemeF merged commit dad415d into main Oct 23, 2026
2 checks passed
@GraemeF
GraemeF deleted the comms-3mpxj branch October 23, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant