Skip to content

Conversation

Copy link

Copilot AI commented Jan 20, 2026

Description

Local server stress tests picked channels uniformly from all instances, causing skew toward common types. With 100 SharedMaps and 10 SharedStrings, SharedMap had 10x selection probability.

Changed to two-tier selection:

  1. Pick channel type uniformly
  2. Pick instance from selected type

Before:

const channels = await datastore.StressDataObject.getChannels();
const channel = state.random.pick(channels);

After:

const channelsByType = new Map<string, IChannel[]>();
for (const channel of channels) {
    const channelType = channel.attributes.type;
    if (!channelsByType.has(channelType)) {
        channelsByType.set(channelType, []);
    }
    channelsByType.get(channelType)!.push(channel);
}

const selectedType = state.random.pick(Array.from(channelsByType.keys()));
const channel = state.random.pick(channelsByType.get(selectedType)!);

Modified: packages/test/local-server-stress-tests/src/localServerStressHarness.ts (mixinClientSelection function)

Reviewer Guidance

Single function change in test harness. No new test infrastructure needed - existing stress test suite validates behavior. Change maintains same invariants as original (assumes channels exist).


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update channel selection process for stress tests Local server stress tests: two-tier channel selection for uniform type coverage Jan 20, 2026
Copilot AI requested a review from anthony-murphy January 20, 2026 22:55
Copilot AI changed the title Local server stress tests: two-tier channel selection for uniform type coverage Stress tests: two-tier channel selection for uniform type coverage Jan 20, 2026
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.

2 participants