Change in ovirt-engine[master]: core: Fix OvfManagerTest

Code Review gerrit at ovirt.org
Tue Feb 7 17:03:34 UTC 2017


>From Allon Mureinik <amureini at redhat.com>:

Allon Mureinik has submitted this change and it was merged.

Change subject: core: Fix OvfManagerTest
......................................................................


core: Fix OvfManagerTest

@Mock/@Spy annotations do not guarantee any order between them,
making this test inherently racy - if iconDefaultsProvider is
initialized first, it will be available when manager is initialized.
If manager is initialized first, it's will have a null
iconDefaultsProvider, causing some tests to fail.

Since the OsRepository and OvfVmIconDefaultsProvider mocks are read
only anyway, they should be static and initialized ONCE per test case
instead of before every test in such a racy fashion.
As a nice side effect, this will slightly improve the test's runtime.

Change-Id: I5f547092e7934dd73bf2039e9ff08822b95c7fa9
Signed-off-by: Allon Mureinik <amureini at redhat.com>
---
M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/utils/ovf/OvfManagerTest.java
1 file changed, 13 insertions(+), 17 deletions(-)

Approvals:
  Tal Nisan: Looks good to me, approved
  Jenkins CI: Passed CI tests
  Allon Mureinik: Verified



-- 
To view, visit https://gerrit.ovirt.org/71795
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I5f547092e7934dd73bf2039e9ff08822b95c7fa9
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>


More information about the Engine-commits mailing list