Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 23 additions & 23 deletions test/macos/native_ipc_helper_integration_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -113,25 +113,24 @@ defmodule Minga.MacOSNativeIPCHelperIntegrationTest do
{:os_pid, app_pid} = Port.info(sleeper, :os_pid)
euid = File.stat!(File.cwd!()).uid

supervisor =
start_supervised!(
{IPCSupervisor,
name: nil,
server_name: nil,
task_supervisor_name: tasks,
runtime_parent: runtime_parent,
runtime_dir: runtime_dir,
app_instance_id: "app-instance-integration",
app_pid: app_pid,
euid: euid,
launch_nonce: "integration-launch-nonce",
wait_tracker: tracker,
open_wait: open_wait,
open_receipt: open_receipt,
inspect_request: inspect_request,
navigation_request: navigation_request,
kill_checker: fn ^app_pid -> true end}
)
start_supervised!(
{IPCSupervisor,
name: nil,
server_name: nil,
task_supervisor_name: tasks,
runtime_parent: runtime_parent,
runtime_dir: runtime_dir,
app_instance_id: "app-instance-integration",
app_pid: app_pid,
euid: euid,
launch_nonce: "integration-launch-nonce",
wait_tracker: tracker,
open_wait: open_wait,
open_receipt: open_receipt,
inspect_request: inspect_request,
navigation_request: navigation_request,
kill_checker: fn ^app_pid -> true end}
)

on_exit(fn ->
send(buffer, :stop)
Expand All @@ -153,7 +152,6 @@ defmodule Minga.MacOSNativeIPCHelperIntegrationTest do
descriptor: descriptor,
helper: helper,
runtime_parent: runtime_parent,
supervisor: supervisor,
tracker: tracker
}
end
Expand Down Expand Up @@ -243,7 +241,7 @@ defmodule Minga.MacOSNativeIPCHelperIntegrationTest do

assert_receive {:opened, ^target, false, _request_id, _handler}, 2_000
assert Task.yield(task, 100) == nil
assert :ok = Supervisor.stop(ctx.supervisor)
assert :ok = stop_supervised(IPCSupervisor)
assert {output, 1} = Task.await(task, @helper_timeout)
assert output =~ "disconnected"
end
Expand All @@ -254,7 +252,7 @@ defmodule Minga.MacOSNativeIPCHelperIntegrationTest do

assert_receive {:opened, ^target, false, _request_id, _handler}, 2_000
assert Task.yield(task, 100) == nil
assert :ok = Supervisor.stop(ctx.supervisor)
assert :ok = stop_supervised(IPCSupervisor)
assert {output, 5} = Task.await(task, @helper_timeout)
assert output =~ "before accepting"
end
Expand Down Expand Up @@ -316,7 +314,9 @@ defmodule Minga.MacOSNativeIPCHelperIntegrationTest do

assert_receive {:receipt_opened, ^target, false, receipt, server}, 2_000
assert {:ok, _applied} = Server.operation_applied(server, receipt.operation_id, 3, 7)
assert :ok = Supervisor.stop(ctx.supervisor)
assert :ok = stop_supervised(IPCSupervisor)

refute File.exists?(Path.join(ctx.runtime_parent, "com.minga.editor/current.json"))

assert {output, 3} = Task.await(task, @helper_timeout)
result = JSON.decode!(output)
Expand Down
Loading