e2e/qa: check per-type device capacity in ValidDevices#3563
Merged
Conversation
ValidDevices previously filtered only on aggregate MaxUsers/UsersCount, which masked devices that were full on a type-specific counter but had free aggregate slots. A device with max_unicast_users=29 and unicast_users_count=29 could still pass the check with max_users=128 and users_count=61, so qa tests that pinned to such a device hit the onchain unicast cap at connect time. Extend qa.Device with the three per-type counters exposed by the serviceability SDK, add a DeviceUserType enum, and make ValidDevices take the user type so it enforces both the type-specific and aggregate buckets. Update the one existing caller (qa_alldevices_unicast_test.go) to pass DeviceUserTypeUnicast.
snormore
approved these changes
Apr 21, 2026
quay.io 502s have been failing e2e runs (e.g. infra run 24748524460). Mirror quay.io/prometheus/prometheus:v2.54.1 at ghcr.io/malbeclabs/dz-e2e/prometheus:v2.54.1 and point both pull paths at the mirror.
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.
Summary
TestQA_AllDevices_UnicastConnectivity) were failing on devices that had free aggregate slots but zero free slots in a per-type bucket (e.g.max_unicast_users=29 / unicast_users_count=29whilemax_users=128 / users_count=61).qa.Test.ValidDevicesonly consulted the aggregateMaxUsers/UsersCountcounters, so these devices passed the capacity check and failed later at connect time with an onchain cap error.qa.Devicewith the three per-type counters already exposed by the serviceability SDK (unicast, multicast publisher, multicast subscriber), adds aDeviceUserTypeenum, and makesValidDevicestake the user type so it enforces both the type-specific and aggregate buckets.Related: builds on the auto-select fix from #3550, which solved the same class of problem for callers that don't specify a device code.
Testing Verification
go build -tags=qa ./e2e/...cleango vet -tags=qa ./e2e/...cleanValidDevices(DeviceUserTypeUnicast, 2, false)filters out the saturatednyc001-dz002entry that previously leaked through.