Skip to content

Commit

Permalink
snapshot multithread test 13
Browse files Browse the repository at this point in the history
  • Loading branch information
pippocao committed Oct 10, 2024
1 parent fc7c752 commit 56fc8cb
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/bq_log/log/log_snapshot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ namespace bq {
if (cccc.load()) {
cccc11.fetch_add(1);
}
} else {
} else if(!snapshot_buffer_){
if (cccc.load()) {
cccc12.fetch_add(1);
}
Expand Down
9 changes: 0 additions & 9 deletions test/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ int32_t main()
SetConsoleCP(CP_UTF8);
#endif
TEST_GROUP_BEGIN(Bq_Common_Test);
TEST_GROUP(Bq_Common_Test, bq::test, test_property);
TEST_GROUP(Bq_Common_Test, bq::test, test_basic_type);
TEST_GROUP(Bq_Common_Test, bq::test, test_optional);
TEST_GROUP(Bq_Common_Test, bq::test, test_array);
TEST_GROUP(Bq_Common_Test, bq::test, test_string);
TEST_GROUP(Bq_Common_Test, bq::test, test_hash_map);
TEST_GROUP(Bq_Common_Test, bq::test, test_utils);
TEST_GROUP(Bq_Common_Test, bq::test, test_file_manager);
TEST_GROUP(Bq_Common_Test, bq::test, test_thread_atomic);
TEST_GROUP_END(Bq_Common_Test);

TEST_GROUP_BEGIN(Bq_Log_Test);
Expand Down
2 changes: 1 addition & 1 deletion test/test_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ namespace bq {
while (!is_cancelled()) {
bq::test::create_test_log_3_file_appender(snapshot_config[(int32_t)(begin_epoch_ms % 4)]);
log_ptr->take_snapshot(false);
sleep(0);
sleep(begin_epoch_ms % 2);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion test/test_log_2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace bq {
}

{
const uint64_t seconds = 10;
const uint64_t seconds = 1;
test_output_dynamic_param(bq::log_level::info, "testing multithread string log. wait for %" PRIu64 " seconds please...\n if error exist, an assert will be triggered\n", seconds);

multi_thread_string_test_modifier modifier_thread;
Expand Down
2 changes: 1 addition & 1 deletion test/test_log_3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ namespace bq {
snapshot_idx_mode = (snapshot_idx_mode % 1024) + 1;
}

bq::util::log_device_console(bq::log_level::fatal, "%s\t, %p\t, 一:%d\t, 二:%d\t, 开始w:%d\t, w成功:%d\t, 读没b:%d\t, 读成功:%d\t, :%d\t, -分配失败:%d\t, -读:%d\t, 读失败原因:%d\t :%d\t :%d", ccc_continue.load() ? "Y" : "X", ccc_snapshot_obj.load(), cccc1.load(), cccc2.load(), cccc3.load(), cccc4.load(), cccc5.load(), cccc6.load(), cccc7.load(), cccc8.load(), cccc9.load(), cccc10.load(), cccc11.load(), cccc12.load());
bq::util::log_device_console(bq::log_level::fatal, "%s\t, %p\t, 一:%d\t, 二:%d\t, 三开始w:%d\t, 四w成功:%d\t, 五读没b:%d\t, 六读成功:%d\t, 七删:%d\t, 八换-分配失败:%d\t, 九换-读:%d\t, 十读失败原因:%d\t 十一换:%d\t 十二创:%d", ccc_continue.load() ? "Y" : "X", ccc_snapshot_obj.load(), cccc1.load(), cccc2.load(), cccc3.load(), cccc4.load(), cccc5.load(), cccc6.load(), cccc7.load(), cccc8.load(), cccc9.load(), cccc10.load(), cccc11.load(), cccc12.load());

size_t new_percent = (size_t)(current_tested_num * 100 / total_test_num);
if (new_percent != current_tested_percent) {
Expand Down

0 comments on commit 56fc8cb

Please sign in to comment.