Skip to content

Commit

Permalink
Update CI images because of deprecations (#4289)
Browse files Browse the repository at this point in the history
* Update CI images because of deprecations
* Make sure metrics are available
* Fix system tests logs permissions

---------

Co-authored-by: Hans Svensson <hanssv@gmail.com>
  • Loading branch information
dincho and hanssv committed Mar 11, 2024
1 parent 347c3d1 commit ed27ede
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .circleci/config/commands/@docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ setup_docker:
steps:
- setup_remote_docker:
docker_layer_caching: true
version: "20.10.18"
version: default

docker_login:
steps:
Expand Down
6 changes: 6 additions & 0 deletions .circleci/config/commands/@tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ run_docker_system_test:
name: System Tests
no_output_timeout: 2h
command: |
# The host system might run with "any" UID while the aeternity containers run with 1000:1000
# umask is not great idea, but this is private CI after all, no better solutions without changing the tests
umask 0
make system-test
run_docker_system_smoke_test:
Expand All @@ -86,6 +89,9 @@ run_docker_system_smoke_test:
name: System Smoke Tests
no_output_timeout: 1h
command: |
# The host system might run with "any" UID while the aeternity containers run with 1000:1000
# umask is not great idea, but this is private CI after all, no better solutions without changing the tests
umask 0
make smoke-test-run
docker_system_test:
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config/executors/@executors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ buildpack:
machine_2004:
resource_class: large
machine:
image: ubuntu-2004:202111-01
image: ubuntu-2004:current
docker_layer_caching: true
working_directory: /home/circleci/aeternity
environment:
Expand Down
22 changes: 18 additions & 4 deletions system_test/common/aest_sync_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,8 @@ net_split_mining_power(Cfg) ->
% Check that the larger cluster has more mining power.
Net1MinedBlocks1 = node_mined_retries(Net1Nodes),
Net2MinedBlocks1 = node_mined_retries(Net2Nodes),

ct:log("Net1 mined ~p while Net2 mined ~p", [Net1MinedBlocks1, Net2MinedBlocks1]),
?assert(Net1MinedBlocks1 < Net2MinedBlocks1),

%% Join all the nodes
Expand Down Expand Up @@ -762,15 +764,27 @@ abrupt_stop_mining_node(_Cfg) ->

%% helper functions

%% Metrics are not populated immediately, so let's make sure we poll until there
%% is actually data.
node_mined_retries(Nodes) ->
Metric = "ae.epoch.aecore.mining.retries.value",
lists:foldl(fun(N, Acc) ->
case aest_nodes:read_last_metric(N, Metric) of
undefined -> Acc;
Num -> Acc + Num
end
poll_node_metric(N, Metric, 15) + Acc
end, 0, Nodes).

poll_node_metric(Node, Metric, 0) ->
ct:log("Giving up getting ~p at ~p", [Metric, Node]),
0;
poll_node_metric(Node, Metric, N) ->
case aest_nodes:read_last_metric(Node, Metric) of
undefined ->
timer:sleep(1000),
poll_node_metric(Node, Metric, N - 1);
Value ->
ct:log("~p attempts remaining: Got value ~p for ~p from ~p", [N - 1, Value, Metric, Node]),
Value
end.

ping_interval(Node) ->
get_node_config(Node, ["sync", "ping_interval"]).

Expand Down

0 comments on commit ed27ede

Please sign in to comment.