Skip to content

Commit

Permalink
use standard pager and more stable flake order (#3185)
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanwire authored Mar 27, 2023
1 parent ecc603d commit 96ad271
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions hack/bin/flaky_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import yaml
import argparse
from pydoc import pager

BUCKET_BASEURL = 'https://s3.eu-west-1.amazonaws.com/public.wire.com/ci/failing-tests'
CONCOURSE_BASEURL = 'https://concourse.ops.zinfra.io/teams/main'
Expand Down Expand Up @@ -115,7 +116,7 @@ def associate_comments(flakes, comments, default_comments=''):
flake['comments'] = comments.get(flake['test_name'], default_comments)

def sort_flakes(flakes):
flakes.sort(key=lambda f: len(f['fails']), reverse=True)
flakes.sort(key=lambda f: (-len(f['fails']), f['test_name']), reverse=False)
for flake in flakes:
flake['fails'].sort(key=lambda f: f['build']['end_time'], reverse=True)

Expand Down Expand Up @@ -176,11 +177,6 @@ def pretty_flakes(flakes, today, logs=False):
lines.append(pretty_flake(flake, today, logs))
return '\n'.join(lines)

def pager(s):
pipe = os.popen('less -RS', 'w')
pipe.write(s)
pipe.close()

explain = '''Tips:
Run with --discover to manually discover new flaky tests
Expand Down

0 comments on commit 96ad271

Please sign in to comment.