Skip to content
Snippets Groups Projects
Commit 8bfc205a authored by Alyssa Ross's avatar Alyssa Ross
Browse files

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.
parent e6933b90
No related branches found
No related tags found
No related merge requests found
......@@ -317,6 +317,10 @@ class Tab < OpenStruct
end
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
tabfile.atomic_write(to_json)
end
......
......@@ -327,7 +327,6 @@ class InstalledDependantsTests < LinkTests
f = stub_formula_name(name)
keg = super
Tab.create(f, DevelopmentTools.default_compiler, :libcxx).write
Formula.clear_cache
keg
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment