Decrease primary task slice expiration from 10m to 5m for CrOS HW tests.

Currently, CrOS HW tests will wait 10min for a device on an up-to-date
OS, and fallback to a device running any OS after that.

With crbug.com/1057152, we are now flashing the device to the right OS
as part of the task. So we no longer need to wait so long for the right
device when we can flash it ourselves. Flashing takes about 5min, so a
5min deadline maintains a 10min delay at the worst.

This also moves the expiration value from an arg to a module constant
since the arg was never passed, and likely won't ever be.

Bug: 1057152
Change-Id: Ia66e714b02f9f4b6b0d011fd96a80f42d0294d52
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2287954
Reviewed-by: Brian Sheedy <[email protected]>
Reviewed-by: Kenneth Russell <[email protected]>
Commit-Queue: Ben Pastene <[email protected]>
Cr-Commit-Position: refs/heads/master@{#790145}
diff --git a/testing/trigger_scripts/chromeos_device_trigger.py b/testing/trigger_scripts/chromeos_device_trigger.py
index 71299e4..f835802d9 100755
--- a/testing/trigger_scripts/chromeos_device_trigger.py
+++ b/testing/trigger_scripts/chromeos_device_trigger.py
@@ -31,6 +31,7 @@
 LKGM_FILE_PATH = os.path.join(SRC_DIR, 'chromeos', 'CHROMEOS_LKGM')
 # Should match something that looks like "12345.0.0".
 LKGM_RE = re.compile(r'\d+\.\d+\.\d+')
+PRIMARY_SLICE_EXPIRATION_S = 300
 
 
 def read_current_lkgm():
@@ -64,10 +65,6 @@
       dest='optional_dimensions',
       help='Optional dimensions which will result in additional task slices. '
            'Duplicated from the `swarming.py trigger` command.')
-  parser.add_argument(
-      '--primary-expiration', type=int, default=600,
-      help='How long to wait (in seconds) for an available bot in the primary '
-           'task slice.')
   # BaseTestTriggerer's setup_parser_contract() takes care of adding needed
   # swarming.py args if they're not already present. But only do this if
   # '--shard-index' is passed in. (The exact usage of trigger scripts are
@@ -127,7 +124,7 @@
       '--optional-dimension',
       'device_os',
       current_lkgm,
-      str(args.primary_expiration),
+      str(PRIMARY_SLICE_EXPIRATION_S),
   ])
   new_args += additional_args[1:]