Skip to content

e2e/qa: skip per-type capacity check when onchain max is zero#3697

Draft
nikw9944 wants to merge 1 commit into
mainfrom
nikw9944/infra-1294
Draft

e2e/qa: skip per-type capacity check when onchain max is zero#3697
nikw9944 wants to merge 1 commit into
mainfrom
nikw9944/infra-1294

Conversation

@nikw9944
Copy link
Copy Markdown
Contributor

@nikw9944 nikw9944 commented May 13, 2026

Summary of Changes

  • Add a typeMax > 0 guard to the per-type capacity check in qa.Test.ValidDevices so it mirrors the onchain semantic. Onchain (smartcontract/programs/doublezero-serviceability/src/processors/user/create_core.rs), the per-type cap is only enforced when max > 0; a max of zero means "no per-type cap." The QA filter now falls through to the aggregate MaxUsers - UsersCount check in that case.
  • Fixes the mainnet-beta qa.alldevices regression introduced by e2e/qa: check per-type device capacity in ValidDevices #3563, where the test dropped from exercising 85 devices to 3. 92 of 96 activated mainnet-beta devices have max_unicast_users == 0 and were silently excluded; only the three with a non-zero per-type cap and free slots (fra-velia, frankry, allnodes-fra1) survived.
  • The original e2e/qa: check per-type device capacity in ValidDevices #3563 bug fix is preserved: any device with a non-zero per-type cap that is saturated (e.g. nyc001-dz002 at max_unicast_users=29, unicast_users_count=29) is still filtered because max > 0 && max - count < minCapacity.
  • Adds table-driven unit tests in e2e/internal/qa/test_test.go covering: per-type cap saturated (still excluded), per-type max zero with users (now included), aggregate cap saturated under zero per-type cap (still excluded), skipCapacityCheck, "test"-coded devices, and equivalent coverage for multicast publisher/subscriber.
  • Fixes malbeclabs/infra#1294

Testing Verification

  • New TestValidDevices_Unicast, TestValidDevices_MulticastPublisher, and TestValidDevices_MulticastSubscriber table tests pass under go test ./e2e/internal/qa/....
  • Reverted the production fix locally and re-ran the regression case TestValidDevices_Unicast/per-type_max_zero_with_users_counted_is_included_(regression_fix); it failed as expected (frankfurt-edge missing from result), confirming the test would have caught this regression had it existed when e2e/qa: check per-type device capacity in ValidDevices #3563 landed.
  • go vet ./e2e/internal/qa/... and go build -tags=qa ./e2e/internal/qa/... both clean.
  • Live-verified against mainnet-beta (2026-05-13): the qa.alldevices run with this fix correctly includes ~85+ devices. Devices with max_unicast_users=0 pass through to the aggregate check. nyc001-dz002 (saturated at 29/29) is correctly filtered by the per-type check.

Mirror the onchain semantic in qa.Test.ValidDevices: a per-type max of zero (max_unicast_users, max_multicast_publishers, max_multicast_subscribers) means the cap is not enforced. The create_core user processor only fails with MaxUnicastUsersExceeded when max > 0 && count >= max, so the QA filter should skip the per-type bucket entirely when max is zero and fall through to the aggregate users check.

Fixes the regression where qa.alldevices on mainnet-beta dropped from testing 85 devices to testing 3 — 92 of 96 activated mainnet-beta devices have max_unicast_users == 0 and were silently excluded.

malbeclabs/infra#1294
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