JUnit测试仅在Jenkins上失败,出现空指针异常(NPE)。

huangapple 未分类评论46阅读模式
英文:

JUnit Test failing only on Jenkins with NPE

问题

我有一个 JUnit 测试,在本地环境和一些 Jenkins 流水线上运行正常,但在某个流水线上失败(我们称之为 develop)。此外,如果我从相同的 Git 分支重新创建一个 Jenkins 流水线,测试将会通过。
如果我删除失败的流水线,并创建一个新的流水线,使用不同的名称(测试通过),但我将其重新命名为 develop(失败的那个名称),它又会再次失败。

我想这可能与 Jenkins 有关,因为它只在特定的流水线上发生,但是否有人之前遇到过这种情况呢?

英文:

I have a JUnit test which runs ok on local environment and even on some Jenkins pipelines, but on a certain pipeline fails(let's call it develop). Furthermore, if i recreate a jenkins pipeline from the same git branch, the test will pass.
If i delete the failing pipeline and i create a new one with a different name(on which the test is passing), but i rename it back to develop(the failing one), it starts to fail again.

I imagine this is somehow related to Jenkins since it is only occurring on certain pipelines, but has somebody encountered this before?

huangapple
  • 本文由 发表于 2020年4月6日 20:39:37
  • 转载请务必保留本文链接:https://java.coder-hub.com/61060087.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定