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
Feature flag tests have been flaky since the Angular 13/14 upgrade. The
problematic change was actually #6056, where we started using
resetSelectors everywhere.
There is one test where a dialog with FeatureFlagDialogContainer is
opened. Sometimes FeatureFlagDialogContainer would not complete
initialization until after the test was torn down and the selectors
reset, meaning NgRx selector calls would fail since state is undefined
at that point.
To workaround this problem, I allow FeatureFlagDialogContainer to be
replaced by a simpler TestableFeatureFlagDialogComponent that has no
dependencies on NgRx. This is a strategy we've used elsewhere in the
code:
https://github.com/tensorflow/tensorboard/blob/dca18190a18ac151437bb6fcd128bc49af617ae5/tensorboard/webapp/metrics/views/card_renderer/scalar_card_container.ts#L206
While I was in this code, I did some other cleanup:
* Stop running the feature flag view tests twice. Only run them as part
of the feature flag test suite.
* When FeatureFlagModalTriggerContainer is destroyed, unsubscribe from
some subjects created in ngOnInit.
* Remove some unnecessary setup from FeatureFlagModalTriggerContainer
tests.
Alternative solution:
* I thought I could solve the problem by calling dialog.close() in the
tests but observed that closing the dialog is not enough to prevent the
child component from instantiating after the test.
0 commit comments