Skip to content

Commit 1be2140

Browse files
[LNT] Sort machines by ID as expected by test case
Summary: `tests/lnttool/admin.shtest` fails in some environments because it expects the `list-machines` output in a certain order. Assuming ascending order, the matching sort would be the one based on the id. In particular, "localhost" follows "LNT" in both ASCII `strcmp` and also with case-insensitive sorting, and the test expects "localhost" first. I'm open to doing the sorting on the client side, but this patch sorts on the server side mainly to demonstrate that the expectation of the test was unwarranted given the state of the code. Sorting on the server side also benefits all clients, as opposed to just the ones that are part of this package. Reviewers: cmatthews, thopre, kristof.beyls Reviewed By: cmatthews Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D67884 llvm-svn: 373129
1 parent 4ac1893 commit 1be2140

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lnt/server/ui/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class Machines(Resource):
100100
def get():
101101
ts = request.get_testsuite()
102102
session = request.session
103-
machines = session.query(ts.Machine).all()
103+
machines = session.query(ts.Machine).order_by(ts.Machine.id).all()
104104

105105
result = common_fields_factory()
106106
result['machines'] = machines

0 commit comments

Comments
 (0)