weixin_39725594 2020-11-29 21:14
浏览 0

Should fix intermittent and puzzling test failure in cmd/machine.

Description of change

This failure is observed only in develop, so newly added tests were suspect. The failure was puzzling because it would not actually produce a trace and will look like this http://ci.jujucharms.com/job/github-check-merge-juju/2693/testReport/junit/github/com_juju_juju_cmd_juju_machine/TestPackage/ Absence of any form of a stack trace is concerning and pointed to a failure outside of juju codebase, specifically a failure in gomocks as the external library used by this tests. Upon further investigation, the tests here construct mock controller in setuptest using gc.C (our custom equivalent of testing.T). However, we know that the instance of gc.C at test setup is different to the instance used by any one test. See also https://github.com/golang/mock/issues/51

As a consequence, this PR ensures that mock controller is constructed by each test with correct gc.C instance.

I will build this PR several times as the problem seems to be more apparent on CI machines.

Run 1: Pass Run 2: Pass Run 3: Pass Run 4: Pass

Bug reference

https://bugs.launchpad.net/juju/+bug/1783284

该提问来源于开源项目:juju/juju

  • 写回答

5条回答 默认 最新

  • weixin_39725594 2020-11-29 21:14
    关注
    评论

报告相同问题?