gce_au_worker: Add a loop counter to avoid instance name collision

Instances are named with the timestamp (second precision) when they are created.
If multiple instances are created in the same second, name collisions happen.
While this may sound rare, due to the fact that instance names are bound in a
non-blocking forloop, this does happen, actually frequently. So we are adding a
forloop counter as a suffix to avoid collisions.

TEST=unit test and trybot run against lakitu-pre-cq, with a custom
    gce_tests.json that has multiple test entries.

Change-Id: I1bc29e6322be2e81387215cb152ae73b0f5575ab
Reviewed-on: https://chromium-review.googlesource.com/314111
Commit-Ready: Daniel Wang <wonderfly@google.com>
Tested-by: Daniel Wang <wonderfly@google.com>
Reviewed-by: Amey Deshpande <ameyd@google.com>
1 file changed