Description
When running IT tests on the 5.1.3 RC1, and on the master (5.2) HEAD, I get flappy behavior on AlterTestsWithViewsIT.testCreateViewWithPropsMaintainsOwnProps. When a particular param set is run standalone, it seems to consistently pass. However, when run in concert with different param iterations, it sometimes generates an NPE on
assertFalse(viewTable1.useStatsForParallelization());
This is because viewTable1 had previously been unset for useStatsForParallelization, so it returns null if it doesn't pick up the change to the base table properly.
This seems to be a caching problem – populating viewTable1 and viewTable2 from a call to PhoenixRuntime.getTableNoCache seems to fix it.
However, since the test updates the base table from a global connection, and then tries to access views on that table from a separate tenant connection, it's not obvious to me that the cache for the tenant connection should be expired in this situation, so I'm not sure the caching behavior counts as a bug itself.
Interestingly though, 5.1.2 doesn't seem to have this issue.