Refactor memoization of the global distribution locator.

Review Request #4214 — Created Sept. 9, 2016 and submitted

jsirois, wisechengyi

Previously it was memoized on the DistributionLocator class.
This meant that it survived resetting the subsystem instances
in tests, and required a special, non-obvious workaround.

Now we memoize it on the subsystem instance, so it gets cleaned
up when the subsystem is reset. This change therefore also gets
rid of the workaround, which makes some tests simpler.

  • This change also adds subsystem initialization to a test that
    needed it (unclear how that test worked before, possibly it
    implicitly relied on some unclean state from a previous test).

  • It also adds what seems like an unnecessary subsystem reference
    in another test, which will hopefully cleared up in a subsequent
    change. It's hard to debug because it only happens on Travis CI.

  • It also removes the argument to _create_locator(), since it was
    never used in practice.

This change will facilitate a pending change to simplify how we
initialize and instantiate subsystems in tests.

CI passes:

  1. Ship It!
    1. Thanks for the quick review John! Submitted.

Review request changed

Status: Closed (submitted)

Change Summary:


  1. This seems to have added a pants.pex to the root of the repo.

    Otherwise, looks fine.

    1. What the...?

    2. Will remove. Unclear how the hell that happened.

    3. Removed in, thanks for the heads-up!