Skip to content

Bug: Group sync test has tautological assertion and measures wrong client perspective #1709

@api-Hypernova

Description

@api-Hypernova

Describe the bug

The groupsync test in measurements/perf-matrix.test.ts has two bugs that make it ineffective:

  1. Tautological assertion: The test asserts expect(members.length).toBe(members.length), which compares a value to itself and will always pass regardless of actual member count.
  2. Wrong sync perspective: The test measures sync() time from the group creator's client immediately after group creation. Since the creator already has all group data locally, this measures a near-no-op rather than actual network sync performance.
// Current implementation (lines 162-166)it(`groupsync-${i}(${populateSize})[${installationPerMember}]:sync a large group of ${i} members ${i}`, async () => {  await newGroup.sync();  // Creator syncing their own just-created group  const members = await newGroup.members();  expect(members.length).toBe(members.length);  // Always true});

Expected behavior

  1. The assertion should verify that the member count equals the expected value (i).
  2. The sync should be measured from a receiver's perspective (a member who wasn't the creator) to capture actual network fetch time for group data.

Steps to reproduce the bug

  1. Run the performance test suite with BATCH_SIZE=10
  2. Observe the groupsync-10 test always passes
  3. Modify the group creation to add fewer members than i
  4. Observe the test still passes (because members.length === members.length is always true)
  5. Check the timing results — sync duration will be minimal since creator already has all data locally

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions