Skip to content

Commit e4cea3e

Browse files
committed
Fix tests fail on macos
1 parent ca3129c commit e4cea3e

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242

4343
### Fixed
4444
- `read_last()` now returns actual slot size instead of always returning full `element_size`
45+
- Test queue names shortened to comply with macOS 31-character shared memory name limit
4546

4647
### Performance
4748
- O(1) `read_last()` via direct atomic load (improved from reserved_info calculation)

tests/test_read_last_interop.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ def test_python_publish_cpp_read_last():
5050
print("TEST: Python Publisher -> C++ read_last()")
5151
print("=" * 70)
5252

53-
queue_name = f"test_read_last_py_cpp_{os.getpid()}"
53+
# Use shorter name for macOS 31-char limit
54+
queue_name = f"rl_py_cpp_{os.getpid()}"
5455

5556
try:
5657
# Python creates queue and publishes data
@@ -124,7 +125,8 @@ def test_cpp_publish_python_read_last():
124125
print("TEST: C++ Publisher -> Python read_last()")
125126
print("=" * 70)
126127

127-
queue_name = f"test_read_last_cpp_py_{os.getpid()}"
128+
# Use shorter name for macOS 31-char limit
129+
queue_name = f"rl_cpp_py_{os.getpid()}"
128130

129131
try:
130132
# Python creates queue first
@@ -203,7 +205,8 @@ def test_read_last_concurrent_publishing():
203205
print("TEST: Concurrent Publishing -> read_last()")
204206
print("=" * 70)
205207

206-
queue_name = f"test_read_last_concurrent_{os.getpid()}"
208+
# Use shorter name for macOS 31-char limit
209+
queue_name = f"rl_conc_{os.getpid()}"
207210

208211
try:
209212
# Python creates queue
@@ -294,7 +297,8 @@ def test_read_last_format_compatibility():
294297
K_INVALID_INDEX
295298
)
296299

297-
queue_name = f"test_read_last_format_{os.getpid()}"
300+
# Use shorter name for macOS 31-char limit
301+
queue_name = f"rl_fmt_{os.getpid()}"
298302

299303
try:
300304
# Create queue with Python (modern format)
@@ -374,7 +378,8 @@ def test_read_last_multi_slot():
374378
print("TEST: read_last() with Multi-Slot Publishes")
375379
print("=" * 70)
376380

377-
queue_name = f"test_read_last_multisize_{os.getpid()}"
381+
# Use shorter name for macOS 31-char limit
382+
queue_name = f"rl_multi_{os.getpid()}"
378383

379384
try:
380385
q = SlickQueue(name=queue_name, size=128, element_size=32)

0 commit comments

Comments
 (0)