Skip to content

Commit

Permalink
Fix subset_test
Browse files Browse the repository at this point in the history
  • Loading branch information
Neylix committed Jul 12, 2023
1 parent ed425a4 commit 5b4c050
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions test/archethic/beacon_chain/subset_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,20 @@ defmodule Archethic.BeaconChain.SubsetTest do
})

MockClient
|> expect(:send_message, 2, fn _, %Ping{}, _ -> {:ok, %Ok{}} end)
|> expect(:send_message, fn _, %GetNetworkStats{subsets: _}, _ ->
{:ok,
%NetworkStats{
stats: %{
subset => %{
node1_key => [%{latency: 90}, %{latency: 100}],
node2_key => [%{latency: 90}, %{latency: 100}]
|> stub(:send_message, fn
_, %Ping{}, _ ->
{:ok, %Ok{}}

_, %GetNetworkStats{subsets: _}, _ ->
{:ok,
%NetworkStats{
stats: %{
subset => %{
node1_key => [%{latency: 90}, %{latency: 100}],
node2_key => [%{latency: 90}, %{latency: 100}]
}
}
}
}}
}}
end)
|> expect(:get_availability_timer, 4, fn _, _ -> 0 end)

Expand Down Expand Up @@ -270,13 +273,13 @@ defmodule Archethic.BeaconChain.SubsetTest do

send(pid, {:current_epoch_of_slot_timer, slot_time})

assert_receive {:summary_stored, summary}
assert_receive {:summary_stored, summary}, 2000

assert %Summary{
subset: ^subset,
summary_time: ^slot_time,
transaction_attestations: [^attestation],
network_patches: ["F8A", "48A"]
network_patches: ["F7A", "78A"]
} = summary

Process.sleep(5)
Expand Down

0 comments on commit 5b4c050

Please sign in to comment.