Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Abingcbc committed Dec 27, 2024
1 parent 0080a27 commit 8c0d132
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions core/unittest/pipeline/PipelineUpdateUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class PipelineUpdateUnittest : public testing::Test {
APSARA_TEST_EQUAL_FATAL(to + 1, i);
return;
}
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
}
}

Expand Down Expand Up @@ -441,7 +441,7 @@ void PipelineUpdateUnittest::TestPipelineParamUpdateCase1() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
processor->Unblock();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -568,7 +568,7 @@ void PipelineUpdateUnittest::TestPipelineParamUpdateCase4() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
LogtailPluginMock::GetInstance()->UnblockProcess();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -625,7 +625,7 @@ void PipelineUpdateUnittest::TestPipelineTypeUpdateCase1() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
processor->Unblock();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -752,7 +752,7 @@ void PipelineUpdateUnittest::TestPipelineTypeUpdateCase4() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
LogtailPluginMock::GetInstance()->UnblockProcess();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -809,7 +809,7 @@ void PipelineUpdateUnittest::TestPipelineTopoUpdateCase1() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
processor->Unblock();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -861,7 +861,7 @@ void PipelineUpdateUnittest::TestPipelineTopoUpdateCase2() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
processor->Unblock();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -920,7 +920,7 @@ void PipelineUpdateUnittest::TestPipelineTopoUpdateCase3() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
processor->Unblock();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -1211,7 +1211,7 @@ void PipelineUpdateUnittest::TestPipelineTopoUpdateCase10() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
LogtailPluginMock::GetInstance()->UnblockProcess();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -1269,7 +1269,7 @@ void PipelineUpdateUnittest::TestPipelineTopoUpdateCase11() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
LogtailPluginMock::GetInstance()->UnblockProcess();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -1320,7 +1320,7 @@ void PipelineUpdateUnittest::TestPipelineTopoUpdateCase12() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
LogtailPluginMock::GetInstance()->UnblockProcess();
});
pipelineManager->UpdatePipelines(diffUpdate);
Expand Down Expand Up @@ -1385,11 +1385,11 @@ void PipelineUpdateUnittest::TestPipelineInputBlock() const {
pipelineManager->UpdatePipelines(diffUpdate);
BlockProcessor(configName);
});
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
APSARA_TEST_NOT_EQUAL_FATAL(future_status::ready, result1.wait_for(chrono::milliseconds(0)));
input->Unblock();
auto result2 = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
processor->Unblock();
});
result1.get();
Expand Down Expand Up @@ -1438,7 +1438,7 @@ void PipelineUpdateUnittest::TestPipelineGoInputBlockCase1() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() { pipelineManager->UpdatePipelines(diffUpdate); });
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
APSARA_TEST_NOT_EQUAL_FATAL(future_status::ready, result.wait_for(chrono::milliseconds(0)));
LogtailPluginMock::GetInstance()->UnblockStop();
result.get();
Expand Down Expand Up @@ -1489,7 +1489,7 @@ void PipelineUpdateUnittest::TestPipelineGoInputBlockCase2() const {
pipelineConfigObjUpdate.Parse();
diffUpdate.mModified.push_back(std::move(pipelineConfigObjUpdate));
auto result = async(launch::async, [&]() { pipelineManager->UpdatePipelines(diffUpdate); });
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
APSARA_TEST_NOT_EQUAL_FATAL(future_status::ready, result.wait_for(chrono::milliseconds(0)));
LogtailPluginMock::GetInstance()->UnblockStop();
result.get();
Expand Down Expand Up @@ -1681,7 +1681,7 @@ void PipelineUpdateUnittest::TestPipelineUpdateManyCase1() const {
pipelineConfigObjUpdate3.Parse();
diffUpdate3.mModified.push_back(std::move(pipelineConfigObjUpdate3));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
auto processor1
= static_cast<ProcessorMock*>(const_cast<Processor*>(pipeline1->mProcessorLine[0].get()->mPlugin.get()));
processor1->Unblock();
Expand Down Expand Up @@ -1759,7 +1759,7 @@ void PipelineUpdateUnittest::TestPipelineUpdateManyCase2() const {
pipelineConfigObjUpdate3.Parse();
diffUpdate3.mModified.push_back(std::move(pipelineConfigObjUpdate3));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
auto processor1
= static_cast<ProcessorMock*>(const_cast<Processor*>(pipeline1->mProcessorLine[0].get()->mPlugin.get()));
processor1->Unblock();
Expand Down Expand Up @@ -1837,7 +1837,7 @@ void PipelineUpdateUnittest::TestPipelineUpdateManyCase3() const {
pipelineConfigObjUpdate3.Parse();
diffUpdate3.mModified.push_back(std::move(pipelineConfigObjUpdate3));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
auto processor1
= static_cast<ProcessorMock*>(const_cast<Processor*>(pipeline1->mProcessorLine[0].get()->mPlugin.get()));
processor1->Unblock();
Expand Down Expand Up @@ -1912,7 +1912,7 @@ void PipelineUpdateUnittest::TestPipelineUpdateManyCase4() const {
pipelineConfigObjUpdate3.Parse();
diffUpdate3.mModified.push_back(std::move(pipelineConfigObjUpdate3));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
auto processor1
= static_cast<ProcessorMock*>(const_cast<Processor*>(pipeline1->mProcessorLine[0].get()->mPlugin.get()));
processor1->Unblock();
Expand Down Expand Up @@ -1988,7 +1988,7 @@ void PipelineUpdateUnittest::TestPipelineUpdateManyCase5() const {
pipelineConfigObjUpdate3.Parse();
diffUpdate3.mModified.push_back(std::move(pipelineConfigObjUpdate3));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
auto processor1
= static_cast<ProcessorMock*>(const_cast<Processor*>(pipeline1->mProcessorLine[0].get()->mPlugin.get()));
processor1->Unblock();
Expand Down Expand Up @@ -2060,7 +2060,7 @@ void PipelineUpdateUnittest::TestPipelineUpdateManyCase6() const {
pipelineConfigObjUpdate3.Parse();
diffUpdate3.mModified.push_back(std::move(pipelineConfigObjUpdate3));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
auto processor1
= static_cast<ProcessorMock*>(const_cast<Processor*>(pipeline1->mProcessorLine[0].get()->mPlugin.get()));
processor1->Unblock();
Expand Down Expand Up @@ -2132,7 +2132,7 @@ void PipelineUpdateUnittest::TestPipelineUpdateManyCase7() const {
pipelineConfigObjUpdate3.Parse();
diffUpdate3.mModified.push_back(std::move(pipelineConfigObjUpdate3));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
auto processor1
= static_cast<ProcessorMock*>(const_cast<Processor*>(pipeline1->mProcessorLine[0].get()->mPlugin.get()));
processor1->Unblock();
Expand Down Expand Up @@ -2201,7 +2201,7 @@ void PipelineUpdateUnittest::TestPipelineUpdateManyCase8() const {
pipelineConfigObjUpdate3.Parse();
diffUpdate3.mModified.push_back(std::move(pipelineConfigObjUpdate3));
auto result = async(launch::async, [&]() {
this_thread::sleep_for(chrono::milliseconds(1000));
this_thread::sleep_for(chrono::milliseconds(2000));
auto processor1
= static_cast<ProcessorMock*>(const_cast<Processor*>(pipeline1->mProcessorLine[0].get()->mPlugin.get()));
processor1->Unblock();
Expand Down

0 comments on commit 8c0d132

Please sign in to comment.