Skip to content

Commit 2a5948d

Browse files
committed
fix build
1 parent 0326171 commit 2a5948d

File tree

6 files changed

+9
-13
lines changed

6 files changed

+9
-13
lines changed

core/app_config/AppConfig.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ class AppConfig {
552552
friend class PollingPreservedDirDepthUnittest;
553553
friend class InputStaticFileUnittest;
554554
friend class LogInputReaderUnittest;
555+
friend class eBPFServerUnittest;
555556
#endif
556557
};
557558

core/plugin/input/InputCpuProfiling.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InputCpuProfiling : public Input {
3030
bool Init(const Json::Value& config, Json::Value& optionalGoPipeline) override;
3131
bool Start() override;
3232
bool Stop(bool isPipelineRemoving) override;
33-
bool SupportAck() const override { return true; }
33+
QueueType GetProcessQueueType() const override { return QueueType::COUNT_BOUNDED; }
3434

3535
ebpf::CpuProfilingOption mCpuProfilingOption;
3636
PluginMetricManagerPtr mPluginMetricPtr;

core/unittest/ebpf/CpuProfilingManagerUnittest.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void CpuProfilingManagerUnittest::TestHandleCpuProfilingEventSingleConfig() {
137137
// create queue
138138
CollectionPipelineContext ctx;
139139
ctx.SetConfigName("test-1");
140-
ProcessQueueManager::GetInstance()->CreateOrUpdateBoundedQueue(key, 0, ctx);
140+
ProcessQueueManager::GetInstance()->CreateOrUpdateCountBoundedQueue(key, 0, ctx);
141141
ProcessQueueManager::GetInstance()->EnablePop("test-1");
142142

143143
// mock AddOrUpdateConfig
@@ -175,11 +175,11 @@ void CpuProfilingManagerUnittest::TestHandleCpuProfilingEventMultiConfig() {
175175
CollectionPipelineContext ctx;
176176
// queue 1
177177
ctx.SetConfigName("test-multi-1");
178-
ProcessQueueManager::GetInstance()->CreateOrUpdateBoundedQueue(key1, 0, ctx);
178+
ProcessQueueManager::GetInstance()->CreateOrUpdateCountBoundedQueue(key1, 0, ctx);
179179
ProcessQueueManager::GetInstance()->EnablePop("test-multi-1");
180180
// queue 2
181181
ctx.SetConfigName("test-multi-2");
182-
ProcessQueueManager::GetInstance()->CreateOrUpdateBoundedQueue(key2, 0, ctx);
182+
ProcessQueueManager::GetInstance()->CreateOrUpdateCountBoundedQueue(key2, 0, ctx);
183183
ProcessQueueManager::GetInstance()->EnablePop("test-multi-2");
184184

185185
// mock AddOrUpdateConfig

core/unittest/ebpf/EBPFServerUnittest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ class eBPFServerUnittest : public testing::Test {
113113
mConfig->mProfileProbeConfig.mProfileUploadDuration = 10;
114114
mConfig->mProcessProbeConfig.mEnableOOMDetect = false;
115115
ebpf::EBPFServer::GetInstance()->Init();
116+
AppConfig::GetInstance()->mPurageContainerMode = false;
116117
}
117118

118119
void TearDown() override {

core/unittest/input/InputCpuProfilingUnittest.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include "collection_pipeline/CollectionPipelineContext.h"
1919
#include "common/JsonUtil.h"
2020
#include "common/http/AsynCurlRunner.h"
21+
#include "container_manager/ContainerManager.h"
2122
#include "ebpf/EBPFServer.h"
2223
#include "plugin/input/InputCpuProfiling.h"
2324
#include "unittest/Unittest.h"
@@ -27,7 +28,6 @@ namespace logtail {
2728
class InputCpuProfilingUnittest : public testing::Test {
2829
public:
2930
void TestName();
30-
void TestSupportAck();
3131
void OnSuccessfulInit();
3232
void OnFailedInit();
3333
void OnSuccessfulStart();
@@ -44,6 +44,7 @@ class InputCpuProfilingUnittest : public testing::Test {
4444
void TearDown() override {
4545
ebpf::EBPFServer::GetInstance()->Stop();
4646
AsynCurlRunner::GetInstance()->Stop();
47+
ContainerManager::GetInstance()->Stop();
4748
}
4849

4950
private:
@@ -57,12 +58,6 @@ void InputCpuProfilingUnittest::TestName() {
5758
APSARA_TEST_EQUAL(name, "input_cpu_profiling");
5859
}
5960

60-
void InputCpuProfilingUnittest::TestSupportAck() {
61-
InputCpuProfiling input;
62-
bool supportAck = input.SupportAck();
63-
APSARA_TEST_TRUE(supportAck);
64-
}
65-
6661
void InputCpuProfilingUnittest::OnSuccessfulInit() {
6762
std::unique_ptr<InputCpuProfiling> input;
6863
Json::Value configJson, optionalGoPipeline;
@@ -152,7 +147,6 @@ void InputCpuProfilingUnittest::OnSuccessfulStop() {
152147
}
153148

154149
UNIT_TEST_CASE(InputCpuProfilingUnittest, TestName)
155-
UNIT_TEST_CASE(InputCpuProfilingUnittest, TestSupportAck)
156150
UNIT_TEST_CASE(InputCpuProfilingUnittest, OnSuccessfulInit)
157151
UNIT_TEST_CASE(InputCpuProfilingUnittest, OnFailedInit)
158152
UNIT_TEST_CASE(InputCpuProfilingUnittest, OnSuccessfulStart)

docker/Dockerfile_coverage

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
FROM sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/loongcollector-community-edition/loongcollector-build-linux:2.1.13
15+
FROM sls-opensource-registry.cn-shanghai.cr.aliyuncs.com/loongcollector-community-edition/loongcollector-build-linux:2.1.12
1616

1717
USER root
1818
WORKDIR /src

0 commit comments

Comments
 (0)