Sort by dict key in order to make the test deterministic

Change-Id: I34e95e7dde4049c2f85dd1efe37ab77e5837d045