[No review required] Add UT for HSS synchronization, and a few code tidy-ups