Skip to content

Commit

Permalink
Fix race with connectivity checker unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
fhunleth committed May 29, 2019
1 parent e25f644 commit d97af0d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/vintage_net/interface/connectivity_checker_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ defmodule VintageNet.Interface.ConnectivityCheckerTest do
alias VintageNet.Interface.ConnectivityChecker

test "disconnected interface" do
start_supervised!({ConnectivityChecker, "disconnected_interface"})

property = ["interface", "disconnected_interface", "connection"]
VintageNet.subscribe(property)

start_supervised!({ConnectivityChecker, "disconnected_interface"})

assert_receive {VintageNet, property, _old_value, :disconnected, _meta}, 1_000
end

test "internet connected interface" do
ifname = get_ifname()
start_supervised!({ConnectivityChecker, ifname})

property = ["interface", ifname, "connection"]
VintageNet.subscribe(property)

start_supervised!({ConnectivityChecker, ifname})

assert_receive {VintageNet, property, _old_value, :internet, _meta}, 1_000
end

Expand Down

0 comments on commit d97af0d

Please sign in to comment.