Skip to content

Commit

Permalink
add stress test
Browse files Browse the repository at this point in the history
  • Loading branch information
teh-cmc committed Dec 22, 2023
1 parent 61551d9 commit 1950030
Showing 1 changed file with 51 additions and 0 deletions.
51 changes: 51 additions & 0 deletions tests/python/gil_stress/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
"""
Stress test for things that tend to GIL deadlock.
Logs many large recordings that contain a lot of large rows.
Usage:
```
python main.py
"""
from __future__ import annotations

import rerun as rr

rec = rr.new_recording(application_id="test")

rec = rr.new_recording(application_id="test")
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

rec = rr.new_recording(application_id="test", make_default=True)
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

rec = rr.new_recording(application_id="test", make_thread_default=True)
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

rec = rr.new_recording(application_id="test") # this works
rr.set_global_data_recording(rec)
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

rec = rr.new_recording(application_id="test") # this works
rr.set_thread_local_data_recording(rec)
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

rec = rr.new_recording(application_id="test", spawn=True)
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

rec = rr.new_recording(application_id="test")
rr.connect(recording=rec)
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

rec = rr.new_recording(application_id="test")
rr.memory_recording(recording=rec)
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

for _ in range(3):
rec = rr.new_recording(application_id="test", make_default=False, make_thread_default=False)
mem = rec.memory_recording()
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

for _ in range(3):
rec = rr.new_recording(application_id="test", make_default=False, make_thread_default=False)
rr.log("test", rr.Points3D([1, 2, 3]), recording=rec.inner)

0 comments on commit 1950030

Please sign in to comment.