Comments (5)
server = httpserver(12306);
应该给每个测试生成不同的端口,并保证在整个测试机上的唯一性,且不能和其他应用程序占用的端口冲突.建议写一个并发保护的全局静态方法从10000开始依次返回加1的数字作为端口号,然后每个setup调用这个唯一的静态方法获取端口号.
from moco.
httpserver全局唯一,是不是就不会有端口被占用的问题了
from moco.
这个取决于surefire的并发模式,如果是多jvm并发,httpserver全局唯一也会有端口冲突。
来自 MEIZU MX
-------- 原始邮件 --------
发件人:Shu Li Zheng [email protected]
时间:周二 11月18日 10:34
收件人:dreamhead/moco [email protected]
抄送:skywolf-dl [email protected]
主题:Re: [moco] 并发测试支持 (#80)
httpserver全局唯一,是不是就不会有端口被占用的问题了
Reply to this email directly or view it on GitHub:
#80 (comment)
from moco.
如果真的是这种多JVM的测试方式,我的建议是启动一个独立的moco server,启动多个moco server,并无必要。
from moco.
这算JUnit用法问题
一个测试类里把 @before 改成@BeforeClass
from moco.
Related Issues (20)
- default if json.req.prop not available HOT 1
- MOCO如何实现带参重定向 HOT 1
- socket请求实现多文件配置
- java.lang.IllegalArgumentException: unknown configuration
- Maven test fails to run moco server when using jacoco maven plugin 0.7.8 or newer #258
- Use URI path parameters on the response template HOT 6
- 返回值类型不支持xml HOT 2
- java.lang.IllegalArgumentException: unknown configuration :[Z@78073c4 HOT 2
- 请求参数中存在中文时,每次请求都报400,怎么进行解决? HOT 1
- 响应体中存在奇数个汉字的时候必定乱码 HOT 5
- 如何支持或的逻辑,以及如何支持对字段名采用正则匹配
- ERROR java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
- 请求超过10MB报错,有配置的地方吗 HOT 3
- 返回response json时,template无法使用
- 加载配置文件无法使用*.json HOT 5
- Asynchronous, Duplicate key Accept-Encoding HOT 3
- 希望能支持响应json直接使用模板语法
- The json in the configuration request needs to match all the json in the body in order for the test to pass HOT 2
- 功能请求: 支持Http SSE(Server-Send Events) API 相关mock能力 HOT 1
- Response header 同时配置content-type & content-length, 响应卡住
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from moco.