tab: clear Formula.installed cache when created.
This was causing the flaky tests that #1508 started skipping. This is the second time that `Formula.installed`'s cache has bitten me with intermittent test failures, and I'd like it to be the last, so I've made it so the cache is cleared automatically when a tab is created. This _should_ mean that the cache is cleared any time it needs to be, with the exception of when a Keg is created artificially with no tab. I don't think there's anything I can do to automatically handle that use-case, though.
This commit is contained in:
parent
e6933b90dc
commit
8bfc205a87
@ -317,6 +317,10 @@ class Tab < OpenStruct
|
|||||||
end
|
end
|
||||||
|
|
||||||
def write
|
def write
|
||||||
|
# If this is a new installation, the cache of installed formulae
|
||||||
|
# will no longer be valid.
|
||||||
|
Formula.clear_cache unless tabfile.exist?
|
||||||
|
|
||||||
CACHE[tabfile] = self
|
CACHE[tabfile] = self
|
||||||
tabfile.atomic_write(to_json)
|
tabfile.atomic_write(to_json)
|
||||||
end
|
end
|
||||||
|
|||||||
@ -327,7 +327,6 @@ class InstalledDependantsTests < LinkTests
|
|||||||
f = stub_formula_name(name)
|
f = stub_formula_name(name)
|
||||||
keg = super
|
keg = super
|
||||||
Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write
|
Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write
|
||||||
Formula.clear_cache
|
|
||||||
keg
|
keg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user