Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ftest intermittently fails: GET_counter_list_returns_counter_type #25

Open
mnibbelink opened this issue Oct 6, 2016 · 1 comment
Open

Comments

@mnibbelink
Copy link
Contributor

The test expects an list of items returned in an exact order, but the API makes no such guarantee, and thus the test fails on my 2 core VM when the results come back in any other order.

Apologies for formatting ... it's hard to make this diff come through.

test_expect > ftest/expected/test_json_interface/GET_counter_list_returns_counter_type
1c1
< {"type_mapping":{"0":"gauge","1":"counter","2":"aggregate"},"pattern":"*","matching_names":[{"is_leaf":false,"type":2,"name":"istatd"},{"is_leaf":true,"type":1,"name":"istatd.http.errors.http"},{"is_leaf":true,"type":0,"name":"foo.bar"},{"is_leaf":true,"type":1,"name":"istatd.http.requests"},{"is_leaf":false,"type":2,"name":"ice"},{"is_leaf":true,"type":0,"name":"istatd.counter.eagerconns"},{"is_leaf":true,"type":1,"name":"istatd.counter.enqueue"},{"is_leaf":true,"type":1,"name":"istatd.counter.dequeue"},{"is_leaf":true,"type":1,"name":"istatd.statserver.connects"},{"is_leaf":false,"type":2,"name":"istatd.http.errors"},{"is_leaf":false,"type":2,"name":"istatd.http"},{"is_leaf":true,"type":0,"name":"istatd.counter.queuelen"},{"is_leaf":false,"type":2,"name":"maybe"},{"is_leaf":false,"type":2,"name":"istatd.statserver"},{"is_leaf":false,"type":2,"name":"istatd.counter"},{"is_leaf":true,"type":1,"name":"istatd.counter.created"},{"is_leaf":true,"type":0,"name":"maybe.gauge"},{"is_leaf":false,"type":2,"name":"foo"},{"is_leaf":true,"type":1,"name":"istatd.statserver.drops"},{"is_leaf":true,"type":0,"name":"ice.cream.bar"},{"is_leaf":false,"type":2,"name":"ice.cream"},{"is_leaf":true,"type":0,"name":"istatd.http.current"},{"is_leaf":true,"type":1,"name":"maybe.counter"}]}

\ No newline at end of file

{"type_mapping":{"0":"gauge","1":"counter","2":"aggregate"},"pattern":"","matching_names":[{"is_leaf":false,"type":2,"name":"istatd"},{"is_leaf":true,"type":0,"name":"foo.bar"},{"is_leaf":true,"type":1,"name":"istatd.http.errors.http"},{"is_leaf":false,"type":2,"name":"ice"},{"is_leaf":true,"type":1,"name":"istatd.http.requests"},{"is_leaf":true,"type":1,"name":"istatd.counter.enqueue"},{"is_leaf":true,"type":0,"name":"istatd.counter.eagerconns"},{"is_leaf":true,"type":1,"name":"istatd.counter.dequeue"},{"is_leaf":true,"type":1,"name":"istatd.statserver.connects"},{"is_leaf":false,"type":2,"name":"istatd.http.errors"},{"is_leaf":false,"type":2,"name":"istatd.http"},{"is_leaf":true,"type":0,"name":"istatd.counter.queuelen"},{"is_leaf":false,"type":2,"name":"maybe"},{"is_leaf":false,"type":2,"name":"istatd.statserver"},{"is_leaf":false,"type":2,"name":"istatd.counter"},{"is_leaf":true,"type":1,"name":"istatd.counter.created"},{"is_leaf":true,"type":0,"name":"maybe.gauge"},{"is_leaf":false,"type":2,"name":"foo"},{"is_leaf":true,"type":0,"name":"ice.cream.bar"},{"is_leaf":false,"type":2,"name":"ice.cream"},{"is_leaf":true,"type":1,"name":"istatd.statserver.drops"},{"is_leaf":true,"type":0,"name":"istatd.http.current"},{"is_leaf":true,"type":1,"name":"maybe.counter"}]}
\ No newline at end of file
EXIT
Saving state in /var/tmp/test/func12898
make: *
* [ftests] Error 1
mitch@vm-mitch4:~/istatd$

@mnibbelink
Copy link
Contributor Author

Note, if you're willing to add a dependency on jq, you can make it consistent with something like this:

mitch@vm-mitch4:/var/tmp/test/func12898$ jq '.matching_names|=sort_by(.name)' a > a.sort
mitch@vm-mitch4:/var/tmp/test/func12898$ jq '.matching_names|=sort_by(.name)' b > b.sort
mitch@vm-mitch4:/var/tmp/test/func12898$ diff a.sort b.sort
mitch@vm-mitch4:/var/tmp/test/func12898$

I may try to put together a patch that does that next.

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

No branches or pull requests

1 participant