(improvement)(project) Fix the issue of occasional failure in the TagTest unit test. (#1500)

This commit is contained in:
lexluo09
2024-08-01 20:05:54 +08:00
committed by GitHub
parent 5a18ad5229
commit cabcbf16ff
3 changed files with 15 additions and 3 deletions

View File

@@ -17,6 +17,12 @@ RUN apt-get update && \
apt-get install -y vim && \
rm -rf /var/lib/apt/lists/*
# Update the package list and install iputils-ping.
RUN apt-get update && apt-get install -y iputils-ping
# 更新包列表并安装 dnsutils 包
RUN apt-get update && apt-get install -y dnsutils
# Copy the supersonic standalone zip file into the container
COPY assembly/build/supersonic-standalone-${SUPERSONIC_VERSION}.zip .

View File

@@ -3,12 +3,13 @@ package com.tencent.supersonic.headless.core.cache;
import com.tencent.supersonic.common.util.ContextUtils;
import com.tencent.supersonic.headless.api.pojo.request.SemanticQueryReq;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.CompletableFuture;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
@@ -18,7 +19,7 @@ public class DefaultQueryCache implements QueryCache {
CacheManager cacheManager = ContextUtils.getBean(CacheManager.class);
if (isCache(semanticQueryReq)) {
Object result = cacheManager.get(cacheKey);
log.info("query from cache, key:{}", cacheKey);
log.info("query from cache, key:{},result:{}", cacheKey, result);
return result;
}
return null;

View File

@@ -10,15 +10,20 @@ import com.tencent.supersonic.headless.api.pojo.request.QueryFilter;
import com.tencent.supersonic.chat.api.pojo.response.QueryResult;
import com.tencent.supersonic.headless.chat.query.rule.detail.DetailFilterQuery;
import com.tencent.supersonic.util.DataUtils;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Slf4j
public class TagTest extends BaseTest {
@Test
public void queryTest_tag_list_filter() throws Exception {
log.info("queryTest_tag_list_filter start");
QueryResult actualResult = submitNewChat("爱情、流行类型的艺人", DataUtils.tagAgentId);
log.info("actualResult:{}", actualResult);
QueryResult expectedResult = new QueryResult();
SemanticParseInfo expectedParseInfo = new SemanticParseInfo();