Refactor memoization of the global distribution locator.

Review Request #4214 - Created Sept. 10, 2016 and submitted

Information
Benjy Weinberger
pants
Reviewers
pants-reviews
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: https://travis-ci.org/pantsbuild/pants/builds/158834172

Benjy Weinberger
John Sirois
Benjy Weinberger
Review request changed

Status: Closed (submitted)

Change Summary:

d9b2e008d87a2f822383063fc285b7849edc93be

Stu Hood

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 https://rbcommons.com/s/twitter/r/4218/, thanks for the heads-up!

Loading...