fix(接口测试): 修复用例清除环境不生效问题 (#11155)

--bug=1010830 --user=赵勇 【接口测试】-case-编辑-删除环境-保存-执行case-执行成功-删除环境操作无效 https://www.tapd.cn/55049933/s/1113206

Co-authored-by: fit2-zhao <yong.zhao@fit2cloud.com>
This commit is contained in:
metersphere-bot 2022-03-03 17:00:28 +08:00 committed by GitHub
parent 5a1d24de70
commit 46520a8503
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 5 deletions

View File

@ -45,11 +45,16 @@ public class KafkaConfig {
producerProps.put(ProducerConfig.MAX_REQUEST_SIZE_CONFIG, kafkaProperties.getMaxRequestSize());
// 批量一次最大拉取数据量
producerProps.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 100);
producerProps.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 6000);
producerProps.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false);// 手动提交 配置 false
// 消费者每次去kafka拉取数据最大间隔服务端会认为消费者已离线触发reBalance
producerProps.put(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, 900000);
// 心跳检查
producerProps.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 5000);
// 手动提交 配置 false
producerProps.put(ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG, false);
producerProps.put(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest");
producerProps.put(ConsumerConfig.AUTO_COMMIT_INTERVAL_MS_CONFIG, 20000);
producerProps.put(ConsumerConfig.MAX_POLL_INTERVAL_MS_CONFIG, 100000);
producerProps.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
producerProps.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
@ -65,7 +70,7 @@ public class KafkaConfig {
//开启批量监听
factory.setBatchListener(true);
factory.getContainerProperties().setPollTimeout(10000);
factory.getContainerProperties().setPollTimeout(60000);
//设置提交偏移量的方式
factory.getContainerProperties().setAckMode(ContainerProperties.AckMode.MANUAL_IMMEDIATE);

View File

@ -459,6 +459,9 @@ export default {
if (env) {
this.$store.state.useEnvironment = env.envId;
this.useEnvironment = env.envId;
} else {
this.$store.state.useEnvironment = "";
this.useEnvironment = "";
}
});
},

View File

@ -1,7 +1,7 @@
<template>
<span>
<el-select :disabled="isReadOnly" v-model="environmentId" size="small" class="environment-select"
:placeholder="$t('api_test.definition.request.run_env')" clearable>
:placeholder="$t('api_test.definition.request.run_env')" clearable @clear="clear">
<el-option v-for="(environment, key) in environments" :key="key"
:label="environment.name"
:value="environment.id"/>
@ -58,6 +58,9 @@
refreshEnvironment(){
this.$emit('setEnvironment', this.environment);
},
clear(){
this.$emit('setEnvironment', {});
},
getEnvironments() {
if (this.projectId) {
this.$get('/api/environment/list/' + this.projectId, response => {