Skip to content

Commit

Permalink
test: increase the overall testrun timeout for e2e tests
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesPiechota committed Jan 31, 2025
1 parent 46115a6 commit af87bd2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 12 deletions.
18 changes: 11 additions & 7 deletions apps/arweave/e2e/ar_e2e.erl
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,17 @@ start_source_node(Node, unpacked, _WalletFixture) ->
}, true),

?LOG_INFO("Source node ~p started.", [Node]),


ar_e2e:assert_syncs_range(Node, 0, 4*?PARTITION_SIZE),

ar_e2e:assert_partition_size(Node, 0, unpacked),
ar_e2e:assert_partition_size(Node, 1, unpacked),
ar_e2e:assert_partition_size(Node, 2, unpacked, floor(0.5*?PARTITION_SIZE)),
ar_e2e:assert_empty_partition(Node, 3, unpacked),

ar_e2e:assert_syncs_range(Node, 0, 4*?PARTITION_SIZE),
ar_e2e:assert_chunks(Node, unpacked, Chunks),

ar_e2e:assert_empty_partition(Node, 3, unpacked),

?LOG_INFO("Source node ~p assertions passed.", [Node]),

ar_test_node:stop(TempNode),
Expand Down Expand Up @@ -148,14 +150,16 @@ start_source_node(Node, PackingType, WalletFixture) ->

SourcePacking = ar_e2e:packing_type_to_packing(PackingType, RewardAddr),

ar_e2e:assert_syncs_range(Node, 0, 4*?PARTITION_SIZE),

ar_e2e:assert_partition_size(Node, 0, SourcePacking),
ar_e2e:assert_partition_size(Node, 1, SourcePacking),
ar_e2e:assert_partition_size(Node, 2, SourcePacking, floor(0.5*?PARTITION_SIZE)),
ar_e2e:assert_empty_partition(Node, 3, SourcePacking),

ar_e2e:assert_syncs_range(Node, 0, 4*?PARTITION_SIZE),

ar_e2e:assert_chunks(Node, SourcePacking, Chunks),

ar_e2e:assert_empty_partition(Node, 3, SourcePacking),

?LOG_INFO("Source node ~p assertions passed.", [Node]),

{[B0, B1, B2, B3, B4, B5], RewardAddr, Chunks}.
Expand Down Expand Up @@ -290,7 +294,7 @@ assert_partition_size(Node, PartitionNumber, Packing, Size) ->
[PartitionNumber, Packing]) >= Size
end,
100,
60_000
120_000
),
iolist_to_binary(io_lib:format(
"~s partition ~p,~p failed to reach size ~p. Current size: ~p.",
Expand Down
4 changes: 2 additions & 2 deletions apps/arweave/e2e/ar_repack_mine_tests.erl
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ test_repack_mine({FromPackingType, ToPackingType}) ->
ar_e2e:assert_partition_size(RepackerNode, 0, ToPacking),
ar_e2e:assert_partition_size(RepackerNode, 1, ToPacking),
ar_e2e:assert_partition_size(RepackerNode, 2, ToPacking, floor(0.5*?PARTITION_SIZE)),
ar_e2e:assert_empty_partition(RepackerNode, 3, ToPacking),
ar_e2e:assert_chunks(RepackerNode, ToPacking, Chunks),
ar_e2e:assert_empty_partition(RepackerNode, 3, ToPacking),

ar_test_node:restart_with_config(RepackerNode, Config#config{
storage_modules = StorageModules,
Expand All @@ -72,8 +72,8 @@ test_repack_mine({FromPackingType, ToPackingType}) ->
ar_e2e:assert_partition_size(RepackerNode, 0, ToPacking),
ar_e2e:assert_partition_size(RepackerNode, 1, ToPacking),
ar_e2e:assert_partition_size(RepackerNode, 2, ToPacking, floor(0.5*?PARTITION_SIZE)),
ar_e2e:assert_empty_partition(RepackerNode, 3, ToPacking),
ar_e2e:assert_chunks(RepackerNode, ToPacking, Chunks),
ar_e2e:assert_empty_partition(RepackerNode, 3, ToPacking),

case ToPackingType of
unpacked ->
Expand Down
6 changes: 4 additions & 2 deletions apps/arweave/include/ar.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,10 @@
-define(RECENT_BLOCKS_WITHOUT_TIMESTAMP, 5).
-endif.

%% How long to wait before giving up on test(s).
-define(TEST_TIMEOUT, 90 * 60).
%% How long to wait before giving up on unit test(s).
-define(TEST_TIMEOUT, 90 * 60). %% 90 minutes
%% How long to wait before giving up on e2e test(s).
-define(E2E_TEST_TIMEOUT, 6 * 60 * 60). %% 6 hours

%% The maximum byte size of a single POST body.
-define(MAX_BODY_SIZE, 15 * 1024 * 1024).
Expand Down
6 changes: 5 additions & 1 deletion apps/arweave/src/ar.erl
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,10 @@ tests(Mod) ->
tests(test, Mod).

tests(TestType, Mods, Config) when is_list(Mods) ->
TotalTimeout = case TestType of
e2e -> ?E2E_TEST_TIMEOUT;
_ -> ?TEST_TIMEOUT
end,
try
start_for_tests(TestType, Config),
ar_test_node:boot_peers(TestType),
Expand All @@ -922,7 +926,7 @@ tests(TestType, Mods, Config) when is_list(Mods) ->
end,
Result =
try
eunit:test({timeout, ?TEST_TIMEOUT, [Mods]}, [verbose, {print_depth, 100}])
eunit:test({timeout, TotalTimeout, [Mods]}, [verbose, {print_depth, 100}])
after
ar_test_node:stop_peers(TestType)
end,
Expand Down

0 comments on commit af87bd2

Please sign in to comment.