Skip to content

Added /etc/ci/chaos_monkey_test.py. - #10899

Merged
bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:chaos-monkey-ci
Apr 30, 2016
Merged

bors-servo merged 1 commit into
servo:masterfrom
asajeffrey:chaos-monkey-ci

Conversation

@asajeffrey

@asajeffrey asajeffrey commented Apr 28, 2016 •

Copy link
Copy Markdown
Contributor

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


This change is Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Apr 28, 2016
@asajeffrey

Copy link
Copy Markdown
Contributor Author

Fixes #10568

Comment thread etc/ci/chaos_monkey_test.py Outdated

for line in TEST_RESULTS.stdout:
report = json.loads(line.decode('utf-8'))
if report.get("action", None) == "process_output":

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for dict.get is None, so explicitly specifying isn't necessary

@asajeffrey

Copy link
Copy Markdown
Contributor Author

Fixed and squashed. You can tell my python is a bit rusty.

Comment thread etc/ci/chaos_monkey_test.py Outdated
from subprocess import Popen, PIPE


def is_crash(report):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method isn't being used, so it can be removed.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@aneeshusa

aneeshusa commented Apr 28, 2016 •

Copy link
Copy Markdown
Contributor

Which outputs of this do you need? We can gate on the exit code, and Buildbot will automatically pick up on anything we print() to stdout. If you want to capture the chaos-monkey.log, we'll need to make that explicit when adding it to steps.yml (or send it to stderr, which should get picked up automatically).

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?

Comment thread etc/ci/chaos_monkey_test.py Outdated
status = report.get("status")
if status:
print(report.get("thread") + " - " + status + " - " + report.get("test"))
TEST_CRASHES = TEST_CRASHES or (status == "CRASH")

@aneeshusa aneeshusa Apr 28, 2016 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nit: I find this easier to read, but up to you:

if status == "CRASH":
    TEST_CRASHES = True

@aneeshusa

Copy link
Copy Markdown
Contributor

Will we ever have both action == 'process_output' and a status? Not sure if you want to avoid printing two lines in that case.

@asajeffrey

asajeffrey commented Apr 28, 2016 •

Copy link
Copy Markdown
Contributor Author

@asajeffrey

Copy link
Copy Markdown
Contributor Author

action and status are exclusive, even if we do get a line with both, it's worth printing out both lots of info.

@asajeffrey

Copy link
Copy Markdown
Contributor Author

Fixed and squashed.

@asajeffrey

asajeffrey commented Apr 28, 2016 •

Copy link
Copy Markdown
Contributor Author

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.

Comment thread etc/ci/chaos_monkey_test.py Outdated
# returned by the test command (which is why we can't use check_output).

test_results = Popen(TEST_CMD, stdout=PIPE)
test_crashes = False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick nit: Let's change this to any_crashes because if any_crashes reads better.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. I'll do this tomorrow, when I'm at a computer.

@asajeffrey

Copy link
Copy Markdown
Contributor Author

Fixed and squashed.

@aneeshusa

Copy link
Copy Markdown
Contributor

@bors-servo r+

We should file a follow-up issue for gating on this in the CI.

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit ac03728 has been approved by aneeshusa

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-awaiting-review There is new code that needs to be reviewed. labels Apr 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants