the test normally passes. but we saw one failure in a valgrind run in github actions (cherry picked from commit 8458baf6a96fa6c6050bac24160f82d32a0b9ed4)