Mitigate flaky test failure about "CRM_Utils_Check_Component_Env->checkVersion()"
authorTim Otten <totten@civicrm.org>
Thu, 9 Apr 2020 04:20:40 +0000 (21:20 -0700)
committerTim Otten <totten@civicrm.org>
Thu, 9 Apr 2020 04:31:41 +0000 (21:31 -0700)
commit0770d5cb04cb828e0893b114661db9dae49afa4d
tree89d15b27afb04c42cfc7266106bd5e6d5713f8f3
parentddf1be1faabbf1866cfa36ff6a52b7f8920da085
Mitigate flaky test failure about "CRM_Utils_Check_Component_Env->checkVersion()"

This function relies on an external data feed. If it fails to fetch the feed, then we
wind up with a PHP warning:

```
Invalid argument supplied for foreach() in CRM_Utils_Check_Component_Env->checkVersion()
(line 475 of /home/me/bknix/build/dmaster/web/sites/all/modules/civicrm/CRM/Utils/Check/Component/Env.php).
```

In certain unit-tests, this warning becomes a false-negative test-failure.
I saw these tests failing recently:

```
CRM_Contact_Page_View_UserDashBoardTest.testDashboardContentContributionsWithInvoicingEnabled
CRM_Contact_Page_View_UserDashBoardTest.testDashboardContentContributions
CRM_Core_Page_HookTest.testFormsCallBuildFormOnce
CRM_Core_Page_HookTest.testPagesCallPageRunOnce
```

Note that it is legit to have some QA signals if the web-service fials, but
that's more of a monitoring issue for the web-service.  It shouldn't
manifest in random unit-tests or random page-views.
CRM/Utils/Check/Component/Env.php