mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 13:12:46 +08:00
Redis returns OK when removing a non-existent set entry (#4434)
This commit is contained in:
committed by
Robert Nishihara
parent
57c1aeb427
commit
c36d03874b
@@ -2840,3 +2840,23 @@ def test_shutdown_disconnect_global_state():
|
||||
with pytest.raises(Exception) as e:
|
||||
ray.global_state.object_table()
|
||||
assert str(e.value).endswith("ray.init has been called.")
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"ray_start_object_store_memory", [10**8], indirect=True)
|
||||
def test_redis_lru_with_set(ray_start_object_store_memory):
|
||||
x = np.zeros(8 * 10**7, dtype=np.uint8)
|
||||
x_id = ray.put(x)
|
||||
|
||||
# Remove the object from the object table to simulate Redis LRU eviction.
|
||||
removed = False
|
||||
start_time = time.time()
|
||||
while time.time() < start_time + 10:
|
||||
if ray.global_state.redis_clients[0].delete(b"OBJECT" +
|
||||
x_id.binary()) == 1:
|
||||
removed = True
|
||||
break
|
||||
assert removed
|
||||
|
||||
# Now evict the object from the object store.
|
||||
ray.put(x) # This should not crash.
|
||||
|
||||
Reference in New Issue
Block a user