aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Kevin Lubick <kjlubick@google.com>2018-03-01 09:21:38 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-01 14:38:44 +0000
commitc6f74ca674c4d6cd5965f5c14d1042e4148f0f68 (patch)
tree4a80fdd731971e048263d6118ffcb3dc50f65d6c
parent5ebaf194445073e920e6a87af0b76f4929640e51 (diff)
Change force_quarantine to use bot id
Bug: skia:7639 Change-Id: I4b8337bac996062c41fb9ae7460cf214b7524a46 Reviewed-on: https://skia-review.googlesource.com/111300 Reviewed-by: Ravi Mistry <rmistry@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json16
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json16
-rw-r--r--infra/bots/recipe_modules/flavor/examples/full.py4
-rw-r--r--infra/bots/recipe_modules/flavor/gn_android_flavor.py4
-rw-r--r--infra/bots/recipes/perf.expected/cpu_scale_failed.json2
-rw-r--r--infra/bots/recipes/perf.expected/cpu_scale_failed_golo.json2
-rw-r--r--infra/bots/recipes/perf.expected/failed_push.json16
-rw-r--r--infra/bots/recipes/perf.py4
-rw-r--r--infra/bots/recipes/test.expected/failed_push.json16
-rw-r--r--infra/bots/recipes/test.py2
10 files changed, 75 insertions, 7 deletions
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json b/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json
index 9ef53509da..b1a252b4af 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/failed_infra_step.json
@@ -1025,12 +1025,26 @@
"cmd": [
"python",
"-u",
+ "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n"
+ ],
+ "name": "get swarming bot id",
+ "stdout": "/path/to/tmp/",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"copy",
" ",
- "/home/chrome-bot/force_quarantine"
+ "/home/chrome-bot/build123-m2--device5.force_quarantine"
],
"infra_step": true,
"name": "Quarantining Bot"
diff --git a/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json b/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json
index 01133125fd..9bbd373d06 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json
+++ b/infra/bots/recipe_modules/flavor/examples/full.expected/retry_adb_command_retries_exhausted.json
@@ -298,12 +298,26 @@
"cmd": [
"python",
"-u",
+ "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n"
+ ],
+ "name": "get swarming bot id",
+ "stdout": "/path/to/tmp/",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"copy",
" ",
- "/home/chrome-bot/force_quarantine"
+ "/home/chrome-bot/build123-m2--device5.force_quarantine"
],
"infra_step": true,
"name": "Quarantining Bot"
diff --git a/infra/bots/recipe_modules/flavor/examples/full.py b/infra/bots/recipe_modules/flavor/examples/full.py
index c86c7701db..d365e0bcd6 100644
--- a/infra/bots/recipe_modules/flavor/examples/full.py
+++ b/infra/bots/recipe_modules/flavor/examples/full.py
@@ -160,6 +160,8 @@ def GenTests(api):
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]') +
+ api.step_data('get swarming bot id',
+ stdout=api.raw_io.output('build123-m2--device5')) +
api.step_data('dump log', retcode=1)
)
@@ -196,6 +198,8 @@ def GenTests(api):
revision='abc123',
path_config='kitchen',
swarm_out_dir='[SWARM_OUT_DIR]') +
+ api.step_data('get swarming bot id',
+ stdout=api.raw_io.output('build123-m2--device5')) +
api.step_data(fail_step_name, retcode=1) +
api.step_data(fail_step_name + ' (attempt 2)', retcode=1) +
api.step_data(fail_step_name + ' (attempt 3)', retcode=1)
diff --git a/infra/bots/recipe_modules/flavor/gn_android_flavor.py b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
index 4aef5dd1f2..ddff49661f 100644
--- a/infra/bots/recipe_modules/flavor/gn_android_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
@@ -494,8 +494,10 @@ wait_for_device()
# broken state; it was just rebooting.
if (self.m.run.failed_steps and
isinstance(self.m.run.failed_steps[0], recipe_api.InfraFailure)):
+ bot_id = self.m.vars.swarming_bot_id
self.m.file.write_text('Quarantining Bot',
- '/home/chrome-bot/force_quarantine', ' ')
+ '/home/chrome-bot/%s.force_quarantine' % bot_id,
+ ' ')
if self._ever_ran_adb:
self._adb('kill adb server', 'kill-server')
diff --git a/infra/bots/recipes/perf.expected/cpu_scale_failed.json b/infra/bots/recipes/perf.expected/cpu_scale_failed.json
index 4f88b376df..9bd374246b 100644
--- a/infra/bots/recipes/perf.expected/cpu_scale_failed.json
+++ b/infra/bots/recipes/perf.expected/cpu_scale_failed.json
@@ -858,7 +858,7 @@
"/path/to/tmp/json",
"copy",
" ",
- "/home/chrome-bot/force_quarantine"
+ "/home/chrome-bot/skia-rpi-022.force_quarantine"
],
"infra_step": true,
"name": "Quarantining Bot"
diff --git a/infra/bots/recipes/perf.expected/cpu_scale_failed_golo.json b/infra/bots/recipes/perf.expected/cpu_scale_failed_golo.json
index 94144a6048..0a073da483 100644
--- a/infra/bots/recipes/perf.expected/cpu_scale_failed_golo.json
+++ b/infra/bots/recipes/perf.expected/cpu_scale_failed_golo.json
@@ -926,7 +926,7 @@
"/path/to/tmp/json",
"copy",
" ",
- "/home/chrome-bot/force_quarantine"
+ "/home/chrome-bot/build123-m2--device5.force_quarantine"
],
"infra_step": true,
"name": "Quarantining Bot"
diff --git a/infra/bots/recipes/perf.expected/failed_push.json b/infra/bots/recipes/perf.expected/failed_push.json
index a1d5942222..72db5a199f 100644
--- a/infra/bots/recipes/perf.expected/failed_push.json
+++ b/infra/bots/recipes/perf.expected/failed_push.json
@@ -93,12 +93,26 @@
"cmd": [
"python",
"-u",
+ "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n"
+ ],
+ "name": "get swarming bot id",
+ "stdout": "/path/to/tmp/",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"copy",
" ",
- "/home/chrome-bot/force_quarantine"
+ "/home/chrome-bot/.force_quarantine"
],
"infra_step": true,
"name": "Quarantining Bot"
diff --git a/infra/bots/recipes/perf.py b/infra/bots/recipes/perf.py
index 1be41e6e63..e6681ce6df 100644
--- a/infra/bots/recipes/perf.py
+++ b/infra/bots/recipes/perf.py
@@ -485,6 +485,8 @@ def GenTests(api):
'svg', 'VERSION'),
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
) +
+ api.step_data('get swarming bot id',
+ stdout=api.raw_io.output('skia-rpi-022')) +
api.step_data('Scale CPU 0 to 0.600000', retcode=1)+
api.step_data('Scale CPU 0 to 0.600000 (attempt 2)', retcode=1)+
api.step_data('Scale CPU 0 to 0.600000 (attempt 3)', retcode=1)
@@ -508,6 +510,8 @@ def GenTests(api):
'svg', 'VERSION'),
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
) +
+ api.step_data('get swarming bot id',
+ stdout=api.raw_io.output('build123-m2--device5')) +
api.step_data('Scale CPU 4 to 0.600000', retcode=1)+
api.step_data('Scale CPU 4 to 0.600000 (attempt 2)', retcode=1)+
api.step_data('Scale CPU 4 to 0.600000 (attempt 3)', retcode=1)
diff --git a/infra/bots/recipes/test.expected/failed_push.json b/infra/bots/recipes/test.expected/failed_push.json
index a1d5942222..756ad2265a 100644
--- a/infra/bots/recipes/test.expected/failed_push.json
+++ b/infra/bots/recipes/test.expected/failed_push.json
@@ -93,12 +93,26 @@
"cmd": [
"python",
"-u",
+ "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n"
+ ],
+ "name": "get swarming bot id",
+ "stdout": "/path/to/tmp/",
+ "~followup_annotations": [
+ "@@@STEP_LOG_LINE@python.inline@import os@@@",
+ "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@",
+ "@@@STEP_LOG_END@python.inline@@@"
+ ]
+ },
+ {
+ "cmd": [
+ "python",
+ "-u",
"RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
"--json-output",
"/path/to/tmp/json",
"copy",
" ",
- "/home/chrome-bot/force_quarantine"
+ "/home/chrome-bot/build123-m2--device5.force_quarantine"
],
"infra_step": true,
"name": "Quarantining Bot"
diff --git a/infra/bots/recipes/test.py b/infra/bots/recipes/test.py
index 0c6a0e7d0f..5d05363a98 100644
--- a/infra/bots/recipes/test.py
+++ b/infra/bots/recipes/test.py
@@ -1119,6 +1119,8 @@ def GenTests(api):
'svg', 'VERSION'),
api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt')
) +
+ api.step_data('get swarming bot id',
+ stdout=api.raw_io.output('build123-m2--device5')) +
api.step_data('push [START_DIR]/skia/resources/* '+
'/sdcard/revenge_of_the_skiabot/resources', retcode=1)
)