You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm looking at FeatureManager.getFeatureManagerOrNull in v4.4.0:
public static FeatureManager getFeatureManagerOrNull() {
ClassLoader classLoader = getContextClassLoader();
FeatureManager featureManager = cache.get(classLoader);
if (featureManager != null) {
return featureManager;
}
featureManager = findFeatureManagerInClassLoader(classLoader);
if (featureManager != null) {
FeatureManager previousFeatureManager = cache.putIfAbsent(classLoader, featureManager);
if (previousFeatureManager != null) {
// Return FeatureManager that was inserted first
return previousFeatureManager; // <--------------- Why?
}
}
return featureManager;
}
I think that this might be causing spurious test failures, because I'm getting test failures related to feature flags for the first test that runs in the suite. I think it might be caused by the wrong feature manager being returned from this method but haven't proved that yet.
Regardless of my test failures, can anyone explain why returning previousFeatureManager is the correct behavior for this method?
The text was updated successfully, but these errors were encountered:
I'm looking at
FeatureManager.getFeatureManagerOrNull
inv4.4.0
:I think that this might be causing spurious test failures, because I'm getting test failures related to feature flags for the first test that runs in the suite. I think it might be caused by the wrong feature manager being returned from this method but haven't proved that yet.
Regardless of my test failures, can anyone explain why returning
previousFeatureManager
is the correct behavior for this method?The text was updated successfully, but these errors were encountered: