this repo has no description
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix test

garrison f8256777 76275f8c

+16 -4
+16 -4
test/trinity_test.exs
··· 2 2 use ExUnit.Case 3 3 4 4 alias Trinity.{SimProcess, Scheduler} 5 + import Trinity.Scheduler, only: [receive_yield: 1] 5 6 6 7 defmodule Counter do 7 8 use GenServer ··· 24 25 Scheduler.run_simulation(fn -> 25 26 nodes = [:n1, :n2, :n3] 26 27 pids = 27 - Enum.map(nodes, fn i -> 28 - Enum.map(1..10, fn i -> 29 - {:ok, pid} = Counter.start_link(i) 30 - pid 28 + Enum.map(nodes, fn node -> 29 + parent = self() 30 + ref = make_ref() 31 + 32 + SimProcess.spawn_node(node, fn -> 33 + pids = Enum.map(1..10, fn i -> 34 + {:ok, pid} = Counter.start_link(i) 35 + pid 36 + end) 37 + 38 + SimProcess.send parent, {ref, pids} 31 39 end) 40 + 41 + receive_yield do 42 + {^ref, pids} -> pids 43 + end 32 44 end) 33 45 |> Enum.concat() 34 46