“选择器循环等待选择".在运行使用Wiremock存根的多个测试用例时 [英] "Selector loop waiting on select" when running multiple test cases which use wiremock stubs

查看:224
本文介绍了“选择器循环等待选择".在运行使用Wiremock存根的多个测试用例时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 wiremock 来模拟Web服务.我正在使用它来提供对我们正在测试的某些单元的服务访问.因此,基本上,我们有多个junit测试,这些测试使用Wiremock中的存根.

I'm using wiremock for mocking a web service. I'm using that to provide a service access to some of units that we are testing. So basically we have multiple junit tests which use stubs from wiremock.

但是,当我们一次运行多个测试(例如运行整个test.java文件)时,它将在完成一些测试用例之后一直等待.日志底部将显示类似以下内容的

But when we run multiple tests at once (let's say run a whole test.java file) it will keep waiting after it completed some of the test cases. And something like following will be displayed at the bottom of the log,

[qtp1669854350-14-selector-ServerConnectorManager@62dfb098/0]
 DEBUG org.eclipse.jetty.io.SelectorManager - Selector loop waiting on select

Junit版本:4.12
Wiremock版本:2.5.0(独立于Wiremock)
Java版本:1.8.0_77

Junit version : 4.12
Wiremock version : 2.5.0 (wiremock-standalone)
Java version : 1.8.0_77

我还检查了此SO问题.但是仍然不知道如何克服这个问题.

Also I checked this SO problem. But still can't figure out how to overcome this.

推荐答案

该消息可能是红色鲱鱼.我建议在暂停期间抓取线程转储(在* nix上杀死-3).这将告诉您代码到底在什么地方阻塞了.

That message is probably a red herring. I suggest grabbing a thread dump during a pause (kill -3 on *nix). That will tell you where exactly the code is blocking.

这篇关于“选择器循环等待选择".在运行使用Wiremock存根的多个测试用例时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆