cluster: add test for race condition

Prevent regression from dfbb2a6912f34c9aa1451cb6d8c2549548b8d8d1.