[server][testMain] Use a Watcher framework to make code simple.