Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.0] Increase max-transaction-time for read_only_trx unit tests #1819

Merged
merged 5 commits into from
Oct 26, 2023
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 17 additions & 31 deletions tests/test_read_only_trx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,16 @@ void test_trxs_common(std::vector<const char*>& specific_args, bool test_disable
std::thread app_thread( [&]() {
try {
fc::logger::get(DEFAULT_LOGGER).set_log_level(fc::log_level::debug);
std::vector<const char*> argv = {"test", "--data-dir", temp_dir_str.c_str(), "--config-dir", temp_dir_str.c_str()};
std::vector<const char*> argv = {
"test", // dummy executible name
"-p", "eosio", "-e", // actual arguments follow
"--data-dir", temp_dir_str.c_str(),
"--config-dir", temp_dir_str.c_str(),
"--max-transaction-time=100",
"--abi-serializer-max-time-ms=999",
"--read-only-write-window-time-us=10000",
"--read-only-read-window-time-us=400000"
};
argv.insert(argv.end(), specific_args.begin(), specific_args.end());
app->initialize<chain_plugin, producer_plugin>(argv.size(), (char**)&argv[0]);
app->find_plugin<chain_plugin>()->chain();
Expand Down Expand Up @@ -179,62 +188,39 @@ void test_trxs_common(std::vector<const char*>& specific_args, bool test_disable

// test read-only trxs on 1 threads (with --read-only-threads)
BOOST_AUTO_TEST_CASE(with_1_read_only_threads) {
std::vector<const char*> specific_args = { "-p", "eosio", "-e",
"--read-only-threads=1",
"--max-transaction-time=10",
"--abi-serializer-max-time-ms=999",
"--read-only-write-window-time-us=100000",
"--read-only-read-window-time-us=40000" };
std::vector<const char*> specific_args = { "--read-only-threads=1" };
test_trxs_common(specific_args);
}

// test read-only trxs on 3 threads (with --read-only-threads)
BOOST_AUTO_TEST_CASE(with_3_read_only_threads) {
std::vector<const char*> specific_args = { "-p", "eosio", "-e",
"--read-only-threads=3",
"--max-transaction-time=10",
"--abi-serializer-max-time-ms=999",
"--read-only-write-window-time-us=100000",
"--read-only-read-window-time-us=40000" };
std::vector<const char*> specific_args = { "--read-only-threads=3" };
test_trxs_common(specific_args);
}

// test read-only trxs on 3 threads (with --read-only-threads)
BOOST_AUTO_TEST_CASE(with_3_read_only_threads_no_tierup) {
std::vector<const char*> specific_args = { "-p", "eosio", "-e",
"--read-only-threads=3",
std::vector<const char*> specific_args = { "--read-only-threads=3",
#ifdef EOSIO_EOS_VM_OC_RUNTIME_ENABLED
"--eos-vm-oc-enable=none",
#endif
"--max-transaction-time=10",
"--abi-serializer-max-time-ms=999",
"--read-only-write-window-time-us=100000",
"--read-only-read-window-time-us=40000" };
};
test_trxs_common(specific_args, true);
}

// test read-only trxs on 8 separate threads (with --read-only-threads)
BOOST_AUTO_TEST_CASE(with_8_read_only_threads) {
std::vector<const char*> specific_args = { "-p", "eosio", "-e",
"--read-only-threads=8",
"--max-transaction-time=10",
"--abi-serializer-max-time-ms=999",
"--read-only-write-window-time-us=10000",
"--read-only-read-window-time-us=400000" };
std::vector<const char*> specific_args = { "--read-only-threads=8" };
test_trxs_common(specific_args);
}

// test read-only trxs on 8 separate threads (with --read-only-threads)
BOOST_AUTO_TEST_CASE(with_8_read_only_threads_no_tierup) {
std::vector<const char*> specific_args = { "-p", "eosio", "-e",
"--read-only-threads=8",
std::vector<const char*> specific_args = { "--read-only-threads=8",
#ifdef EOSIO_EOS_VM_OC_RUNTIME_ENABLED
"--eos-vm-oc-enable=none",
#endif
"--max-transaction-time=10",
"--abi-serializer-max-time-ms=999",
"--read-only-write-window-time-us=10000",
"--read-only-read-window-time-us=400000" };
};
test_trxs_common(specific_args, true);
}

Expand Down
Loading