tests.test_pool module¶
- tests.test_pool.test_manager_definition_inventory()[source]¶
Check every class implementing a package manager is in the pool.
- tests.test_pool.test_manager_classes_order()[source]¶
Check manager classes are ordered by their IDs.
- tests.test_pool.test_manager_count()[source]¶
Check all implemented package managers are accounted for, and unique.
No manager may belong to two lock families, or its lane grouping is ambiguous.
Every lock-family member must be a real manager id (catches typos).
- tests.test_pool.test_lock_families_nest_in_label_groups()[source]¶
Every lock family must sit inside a single ecosystem label group.
The two constants answer different questions.
MANAGER_LABEL_GROUPSgroups managers by the packaging ecosystem an issue lands in,SHARED_LOCK_FAMILIESthe ones that cannot run at once on a real host. The implication runs one way only: contending for a backend lock means sharing that backend’s ecosystem, so a lock family is always contained in a label group.Never the reverse, and the gaps are the point:
finkandopkgspeak dpkg through databases of their own,zerobrewhas its own prefix anddkp-pacmanits own repositories, whilepypi-based,npm-basedand the plugin-manager groups share a registry or a host program rather than any lock at all. Asserting equality here would be asserting those four facts away.Catches a manager wired into a lock family but forgotten in the label groups, which is what it caught for
nala.vcpkgis the one exemption: it shares Homebrew’scmake, a toolchain rather than a package backend, so it joins that family from outside thehomebrewgroup.
A manager delegating to another’s CLI serializes with it.
It runs that manager’s own binary against that manager’s own state.
The delegation is declared in the class body (
Delegate), which makes this derivable rather than a list to keep in step: wiring a new delegate without a lock family fails here.
Every manager inheriting from
Pacmanserializes with that family.Each drives pacman’s own database.
dkp-pacmanis the sole exemption: devkitPro ships it to sit beside a distribution’spacmanwith its own repositories and database, so it contends with nothing. Any other subclass missing from the family is the bug this catches, which is how the AUR helpers went unserialized through7.6.1.Inheritance is a sufficient signal, never a necessary one:
pamacreaches the samelibalpmthrough a bundled definition and is covered by the family without appearing here.
The
ebuild-basedlabel group is one lock family.Its managers record into the same database of installed packages of a Gentoo host, so two of them mutating at once would be two writers of that database.
- tests.test_pool.DERIVED_EXTRA_OPTIONS = frozenset({'cooldown_policy'})¶
Extra options computed from another flag rather than declared as one.
cooldown_policyis resolved from the--cooldownunion and themeta_package_manager.cooldownconfiguration (seemeta_package_manager.cooldown.resolve_cooldown()): the manager-level attribute has no CLI flag of its own, only the per-manager override.
- tests.test_pool.test_select_managers(kwargs, expected)[source]¶
Tuples everywhere check that
select_managers()keeps the order.
- tests.test_pool.test_select_managers_allow_empty_lets_an_empty_selection_through()[source]¶
No manager selected ends the run by default, and yields nothing on request.
- tests.test_pool.test_select_managers_timeout_stamping()[source]¶
The user’s
--timeoutlands on every selected manager.It does so even when unavailable ones are kept (
mpm managers), whose version probes fire lazily at rendering time, after selection: an unstamped instance would fall back to the read-only default and let a wedged binary hold each table row for 120 seconds. A per-manager[mpm.overrides.<id>]override keeps precedence over the global option.
- tests.test_pool.test_select_managers_cooldown_policy_keeps_precedence()[source]¶
A per-manager
cooldown_policyoverride survives the global policy.The override pins that manager’s enforcement posture, so the global policy resolved from
--cooldownmust not clobber it: [mpm.overrides.<id>] cooldown_policy = “best-effort” keeps running that one manager unguarded while the rest stay fail-closed.
- tests.test_pool.test_warm_availability_skips_without_context()[source]¶
No active CLI context: leave probing to the lazy, sequential filter loop.
- tests.test_pool.test_warm_availability_probes_concurrently()[source]¶
With –jobs > 1 and several candidates, probes run off the main thread.
- tests.test_pool.test_merge_into_probe_lanes_groups_by_signature()[source]¶
Managers whose probe may resolve to the same command share a lane.
- tests.test_pool.test_merge_into_probe_lanes_partitions_the_whole_pool()[source]¶
Every manager lands on exactly one lane, whatever the pool grows to.
A lane’s managers probe against one shared
run_cache.Each then gets its own value back: that dict is what collapses
brewandcaskboth runningbrew --versioninto a single subprocess.