This is an archive of the discontinued LLVM Phabricator instance.

[LNT] Sort machines by ID as expected by test case
ClosedPublic

Authored by hubert.reinterpretcast on Sep 21 2019, 1:04 PM.

Details

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.

Diff Detail

Repository
rL LLVM

Event Timeline

Alternatively the test could use -DAG directives. But I do think sorting is nicer as it's easier to find a machine in a long list and doing it on the server side sounds sensible to me. I'll let Chris have the last word though.

Alternatively the test could use -DAG directives. But I do think sorting is nicer as it's easier to find a machine in a long list and doing it on the server side sounds sensible to me. I'll let Chris have the last word though.

@cmatthews, pinging for your opinion.

cmatthews accepted this revision.Sep 27 2019, 11:15 AM

Yeah, this LGTM.

This revision is now accepted and ready to land.Sep 27 2019, 11:15 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2019, 2:55 PM