fix #1343 by randomizing test key, bring back an assertion