Reduce room for raciness in sharing tests

Change-Id: Ia903b0a6b9f9cbb3754f45a821205d30d29c0349