Skip to content

Commit

Permalink
Make loadgen use unique accounts only for transaction submission
Browse files Browse the repository at this point in the history
  • Loading branch information
marta-lokhova committed Jun 21, 2023
1 parent c64889f commit b2e0b69
Show file tree
Hide file tree
Showing 6 changed files with 284 additions and 70 deletions.
5 changes: 3 additions & 2 deletions src/herder/test/UpgradesTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2948,6 +2948,7 @@ TEST_CASE("upgrade to generalized tx set in network", "[upgrades][overlay]")
cfg.MAX_SLOTS_TO_REMEMBER = 12;
cfg.TESTING_UPGRADE_LEDGER_PROTOCOL_VERSION =
static_cast<uint32_t>(GENERALIZED_TX_SET_PROTOCOL_VERSION) - 1;
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 100;
return cfg;
});

Expand Down Expand Up @@ -2977,9 +2978,9 @@ TEST_CASE("upgrade to generalized tx set in network", "[upgrades][overlay]")
}

auto& loadGen = nodes[0]->getLoadGenerator();
// Generate 8 ledgers worth of txs (40 / 5).
// Generate 8 ledgers worth of txs (600 / (15*5)).
loadGen.generateLoad(GeneratedLoadConfig::createAccountsLoad(
/* nAccounts */ 40, /* txRate */ 1, /* batchSize */ 1));
/* nAccounts */ 600, /* txRate */ 1, /* batchSize */ 15));
auto& loadGenDone =
nodes[0]->getMetrics().NewMeter({"loadgen", "run", "complete"}, "run");
auto currLoadGenCount = loadGenDone.count();
Expand Down
6 changes: 3 additions & 3 deletions src/main/test/ApplicationUtilsTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ class SimulationHelper

// Generate a bit of load, and crank for some time
loadGen.generateLoad(GeneratedLoadConfig::txLoad(
LoadGenMode::PAY, /* nAccounts */ 10, /* nTxs */ 10,
LoadGenMode::PAY, /* nAccounts */ 150, /* nTxs */ 10,
/*txRate*/ 1,
/*batchSize*/ 1));

Expand Down Expand Up @@ -243,9 +243,9 @@ class SimulationHelper
{"loadgen", "run", "complete"}, "run");

loadGen.generateLoad(
GeneratedLoadConfig::createAccountsLoad(/* nAccounts */ 10,
GeneratedLoadConfig::createAccountsLoad(/* nAccounts */ 150,
/* txRate */ 1,
/* batchSize */ 1));
/* batchSize */ 15));
auto currLoadGenCount = loadGenDone.count();

auto checkpoint =
Expand Down
19 changes: 11 additions & 8 deletions src/overlay/test/OverlayTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1830,6 +1830,7 @@ TEST_CASE("flow control when out of sync", "[overlay][flowcontrol]")
cfg.PEER_FLOOD_READING_CAPACITY = 1;
cfg.PEER_READING_CAPACITY = 1;
cfg.FLOW_CONTROL_SEND_MORE_BATCH_SIZE = 1;
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 1000;
if (i == 1)
{
cfg.FORCE_SCP = false;
Expand All @@ -1855,9 +1856,9 @@ TEST_CASE("flow control when out of sync", "[overlay][flowcontrol]")
// Generate transactions traffic, which the out of sync node will drop
auto& loadGen = node->getLoadGenerator();
loadGen.generateLoad(
GeneratedLoadConfig::createAccountsLoad(/* nAccounts */ 200,
GeneratedLoadConfig::createAccountsLoad(/* nAccounts */ 3000,
/* txRate */ 1,
/* batchSize */ 1));
/* batchSize */ 15));

auto& loadGenDone =
node->getMetrics().NewMeter({"loadgen", "run", "complete"}, "run");
Expand Down Expand Up @@ -1902,6 +1903,8 @@ TEST_CASE("overlay flow control", "[overlay][flowcontrol]")
cfg.FLOW_CONTROL_SEND_MORE_BATCH_SIZE = 1;
cfg.PEER_FLOOD_READING_CAPACITY_BYTES = 1000;
cfg.FLOW_CONTROL_SEND_MORE_BATCH_SIZE_BYTES = 100;
cfg.TESTING_UPGRADE_MAX_TX_SET_SIZE = 1000;

configs.push_back(cfg);
}

Expand Down Expand Up @@ -1948,9 +1951,9 @@ TEST_CASE("overlay flow control", "[overlay][flowcontrol]")
// close ledgers properly
auto& loadGen = node->getLoadGenerator();
loadGen.generateLoad(
GeneratedLoadConfig::createAccountsLoad(/* nAccounts */ 10,
GeneratedLoadConfig::createAccountsLoad(/* nAccounts */ 150,
/* txRate */ 1,
/* batchSize */ 1));
/* batchSize */ 15));

auto& loadGenDone =
node->getMetrics().NewMeter({"loadgen", "run", "complete"}, "run");
Expand All @@ -1963,7 +1966,7 @@ TEST_CASE("overlay flow control", "[overlay][flowcontrol]")
currLoadGenCount = loadGenDone.count();

loadGen.generateLoad(GeneratedLoadConfig::txLoad(
LoadGenMode::PAY, /* nAccounts */ 10, 200,
LoadGenMode::PAY, /* nAccounts */ 150, 200,
/*txRate*/ 5, /*batchSize*/ 1));

simulation->crankUntil(
Expand Down Expand Up @@ -2619,9 +2622,9 @@ TEST_CASE("overlay pull mode loadgen", "[overlay][pullmode][acceptance]")
// Set a really high tx rate so we create the txns right away.
auto const numAccounts = 5;
loadGen.generateLoad(GeneratedLoadConfig::createAccountsLoad(
/* nAccounts */ numAccounts,
/* txRate */ 1000,
/* batchSize */ 1));
/* nAccounts */ numAccounts * 15,
/* txRate */ 1,
/* batchSize */ 15));

// Let the network close multiple ledgers.
// If the logic to advertise or demand incorrectly sends more than
Expand Down
Loading

0 comments on commit b2e0b69

Please sign in to comment.