Skip to content

Commit 4b94a50

Browse files
committed
Add delays to provoke race condition in testing.
1 parent 49238d2 commit 4b94a50

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

src/py/tests/hang_scripts/WHY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Separate Testing Scripts
2+
3+
These tests have to do with start/end of the python interpreter, so
4+
are run by a subprocess call. That means no pytest interference.

src/py/tests/hang_scripts/open.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
import time
2+
13
import kaleido
24

35
kaleido.start_sync_server()
6+
time.sleep(0.5)
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1+
import time
2+
13
import kaleido
24

35
kaleido.start_sync_server()
6+
time.sleep(0.5)
47
kaleido.stop_sync_server()
8+
time.sleep(0.5)

src/py/tests/test_init.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,13 @@ def kwargs():
3434
_ = kaleido._sync_server.GlobalKaleidoServer.open # noqa: SLF001
3535

3636

37-
def test_hangers():
37+
def test_hangers_open_close():
3838
folder = Path(__file__).parent / "hang_scripts"
3939
subprocess.run([sys.executable, str(folder / "open_close.py")], check=True) # noqa: S603
40+
41+
42+
def test_hangers_open_only():
43+
folder = Path(__file__).parent / "hang_scripts"
4044
subprocess.run([sys.executable, str(folder / "open.py")], check=True) # noqa: S603
4145

4246

0 commit comments

Comments
 (0)