Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdded /etc/ci/chaos_monkey_test.py. #10899
Conversation
|
Fixes #10568 |
|
|
||
| for line in TEST_RESULTS.stdout: | ||
| report = json.loads(line.decode('utf-8')) | ||
| if report.get("action", None) == "process_output": |
This comment has been minimized.
This comment has been minimized.
frewsxcv
Apr 28, 2016
Member
The default value for dict.get is None, so explicitly specifying isn't necessary
| TEST_CRASHES = TEST_CRASHES or (status == "CRASH") | ||
|
|
||
| if TEST_CRASHES: | ||
| exit(1) |
This comment has been minimized.
This comment has been minimized.
|
Fixed and squashed. You can tell my python is a bit rusty. |
| from subprocess import Popen, PIPE | ||
|
|
||
|
|
||
| def is_crash(report): |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
||
| TEST_RESULTS = Popen(TEST_CMD, stdout=PIPE) | ||
| TEST_CRASHES = False | ||
| TEST_STDOUT = {} |
This comment has been minimized.
This comment has been minimized.
aneeshusa
Apr 28, 2016
Member
None of these three are constants, so they should be in lowercase camel_case.
This comment has been minimized.
This comment has been minimized.
| # option. This file may not be copied, modified, or distributed | ||
| # except according to those terms. | ||
|
|
||
| import json |
This comment has been minimized.
This comment has been minimized.
aneeshusa
Apr 28, 2016
•
Member
Let's add from __future__ import absolute_import, print_function above this (with an empty line between that and import json).
This comment has been minimized.
This comment has been minimized.
| for line in TEST_RESULTS.stdout: | ||
| report = json.loads(line.decode('utf-8')) | ||
| if report.get("action") == "process_output": | ||
| print(report.get("thread") + " - " + report.get("data")) |
This comment has been minimized.
This comment has been minimized.
aneeshusa
Apr 28, 2016
•
Member
Let's use str.format to make these nicer:
print("{} - {}".format(report.get('thread'), report.get('data')))
This comment has been minimized.
This comment has been minimized.
| print(report.get("thread") + " - " + report.get("data")) | ||
| status = report.get("status") | ||
| if status: | ||
| print(report.get("thread") + " - " + status + " - " + report.get("test")) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Which outputs of this do you need? We can gate on the exit code, and Buildbot will automatically pick up on anything we I looked at the output and there's quite a bit of it - do we only want to log the CRASHes to output, or is having the rest of it useful as well? |
| status = report.get("status") | ||
| if status: | ||
| print(report.get("thread") + " - " + status + " - " + report.get("test")) | ||
| TEST_CRASHES = TEST_CRASHES or (status == "CRASH") |
This comment has been minimized.
This comment has been minimized.
aneeshusa
Apr 28, 2016
•
Member
style nit: I find this easier to read, but up to you:
if status == "CRASH":
TEST_CRASHES = True
|
Will we ever have both |
|
IRC chat about outputs: http://logs.glob.uno/?c=mozilla%23servo&s=28+Apr+2016&e=28+Apr+2016#c417879 TL;DR: don't capture the whole log. |
|
|
|
Fixed and squashed. |
|
I also increased the probability of pipeline closure to 0.1, to make sure that some crashes happen! This magic number may need played with. |
| # returned by the test command (which is why we can't use check_output). | ||
|
|
||
| test_results = Popen(TEST_CMD, stdout=PIPE) | ||
| test_crashes = False |
This comment has been minimized.
This comment has been minimized.
aneeshusa
Apr 28, 2016
Member
Quick nit: Let's change this to any_crashes because if any_crashes reads better.
This comment has been minimized.
This comment has been minimized.
|
Fixed and squashed. |
|
@bors-servo r+ We should file a follow-up issue for gating on this in the CI. |
|
|
|
Filed #10927 |
Added /etc/ci/chaos_monkey_test.py. Add a test to `/etc/ci` which runs a subset of `test-wpt` with `--random-pipeline-failure-probability=0.2`, and checks to make sure that there's no `CRASH` reports, so the constellation survived the experience, even if a lot of tests failed. IRC conversation at http://logs.glob.uno/?c=mozilla%23servo&s=27+Apr+2016&e=27+Apr+2016#c416510 Fixes #10568. r? @aneeshusa <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10899) <!-- Reviewable:end -->
|
|
asajeffrey commentedApr 28, 2016
•
edited by KiChjang
Add a test to
/etc/ciwhich runs a subset oftest-wptwith--random-pipeline-failure-probability=0.2, and checks to make sure that there's noCRASHreports, so the constellation survived the experience, even if a lot of tests failed.IRC conversation at http://logs.glob.uno/?c=mozilla%23servo&s=27+Apr+2016&e=27+Apr+2016#c416510
Fixes #10568.
r? @aneeshusa
This change is