mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-12-27 01:42:11 +08:00
Fix race condition in tests
This commit is contained in:
parent
4ede27ca69
commit
94f7d3fc89
1 changed files with 6 additions and 1 deletions
|
@ -2122,6 +2122,12 @@ defmodule LivebookWeb.SessionLiveTest do
|
||||||
# Use the standalone runtime, to encapsulate env var changes
|
# Use the standalone runtime, to encapsulate env var changes
|
||||||
Session.set_runtime(session.pid, Runtime.Standalone.new())
|
Session.set_runtime(session.pid, Runtime.Standalone.new())
|
||||||
|
|
||||||
|
# We start the runtime before adding the env var setting,
|
||||||
|
# otherwise a concurrent embedded runtime server could set PATH
|
||||||
|
# in this node and the standalone runtime would inherit it
|
||||||
|
Session.subscribe(session.id)
|
||||||
|
connect_and_await_runtime(session.pid)
|
||||||
|
|
||||||
separator =
|
separator =
|
||||||
case :os.type() do
|
case :os.type() do
|
||||||
{:win32, _} -> ";"
|
{:win32, _} -> ";"
|
||||||
|
@ -2134,7 +2140,6 @@ defmodule LivebookWeb.SessionLiveTest do
|
||||||
attrs = params_for(:env_var, name: "PATH", value: tmp_dir)
|
attrs = params_for(:env_var, name: "PATH", value: tmp_dir)
|
||||||
Settings.set_env_var(attrs)
|
Settings.set_env_var(attrs)
|
||||||
|
|
||||||
Session.subscribe(session.id)
|
|
||||||
{:ok, view, _} = live(conn, ~p"/sessions/#{session.id}")
|
{:ok, view, _} = live(conn, ~p"/sessions/#{session.id}")
|
||||||
|
|
||||||
section_id = insert_section(session.pid)
|
section_id = insert_section(session.pid)
|
||||||
|
|
Loading…
Reference in a new issue