-
Notifications
You must be signed in to change notification settings - Fork 21
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
test failure in Debian bullseye: session/test-01.xml... .(bcacfghi vs. acbcfghi) FAILED #22
Comments
Hi, @pabs3 Please, try to debug this file https://github.com/gobby/libinfinity/blob/master/test/inf-test-text-session.c (function |
I mean sure. The thing is: The algorithm changed its result and it's literally stopping corruption from getting shipped. Someone needs to take a look as to what changed so that the ordering of the first two chunks is consistently wrong. The two requests are effectively reordered when they are not expected to me:
If it wouldn't fail that consistently I'd have said that something started randomizing but that's not what we see in Debian. @aburgm Do you happen to have an idea? |
Not sure why previously the tests are passed, the requests are randomized because of the following code libinfinity/test/inf-test-text-session.c Lines 208 to 219 in e09c5b7
I think the test is expected to fail, since order of the two requests is indeterminate. libinfinity/test/session/test-01.xml Lines 13 to 19 in e09c5b7
|
The order of requests should be irrelevant, which is what the test is testing... it should be decided by user ID to disambiguate otherwise ambiguous cases.
Sent from BlueMail
…On Dec 15, 2019, 17:11, at 17:11, zhsj ***@***.***> wrote:
Not sure why previously the tests are passed, the requests are
randomized because of the following code
https://github.com/gobby/libinfinity/blob/e09c5b7a955fdfab74eaee28edab575e14860962/test/inf-test-text-session.c#L208-L219
I think the test is expected to fail, since order of the two requests
is indeterminate.
https://github.com/gobby/libinfinity/blob/e09c5b7a955fdfab74eaee28edab575e14860962/test/session/test-01.xml#L13-L19
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#22 (comment)
|
So even after staring at the code for a long time and after a lot of printf debugging... In the failing permutation The thing that irritates me the most here is where the code would preserve the state. It does not seem to buffer the request - but then all arrive at the same "time" anyway, so why would it have to. The state vector that it preserves seems to revolve primarily about the time as expressed in count of operations. Shifting the operations one char into the string has the same failure mode as well, Specifically the following premutations trigger the problem: |
As expected this is due to a change in glib - and I thought I was looking at that commit before, but now I finally bisected it:
The full commit:
I also validated that 2.62.5 and 2.63.5 are still broken. |
That being said I am still unsure where the disambiguation of the user ID happens in a way that the hash table behavior matters. |
I checked that GLib 2.64.3 is also still broken. |
This is primarily to help test cases which assume that the adopted algorithm prioritizes the users in the exact order they appear in the test cases (and get inserted into the session in that order). With older glib version, the five users being inserted into the user table hash table by the tests happened to retain the order. With latest glib, due to a minor tweak in hashing strategy, the order of iteration is different from the order of insertion failing the tests. In addition, GHashTable makes no guarantees about the stability of items when iterating multiple times. Since the algorithm is sensitive to order of users, it is best to return users in an order that is consistent over multiple calls and stable over insert/remove operations. This patch sorts the keys during iteration of users in the user table. Closes: gobby#22. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This is primarily to help test cases which assume that the adopted algorithm prioritizes the users in the exact order they appear in the test cases (and get inserted into the session in that order). With older glib version, the five users being inserted into the user table hash table by the tests happened to retain the order. With latest glib, due to a minor tweak in hashing strategy, the order of iteration is different from the order of insertion failing the tests. In addition, GHashTable makes no guarantees about the stability of items when iterating multiple times. Since the algorithm is sensitive to order of users, it is best to return users in an order that is consistent over multiple calls and stable over insert/remove operations. This patch sorts the keys during iteration of users in the user table. Closes: gobby#22. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This is primarily to help test cases which assume that the adopted algorithm prioritizes the users in the exact reverse order they appear in the test cases (and get inserted into the session in reverse order). With older glib version, the five users being inserted happened to return the order expected by the tests. With latest glib, due to a minor tweak in hashing strategy, the insertion leads to unsorted list leading to failed tests. In addition, GHashTable makes no guarantees about the stability of items when iterating multiple times. Since the algorithm is sensitive to order of users, it is best to return users in an order that is consistent over multiple calls and stable over insert/remove operations. This patch maintains a sorted list of user ids and uses it for iteration. Closes: gobby#22. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This is primarily to help test cases which assume that the adopted algorithm prioritizes the users in the exact reverse order they appear in the test cases (and get inserted into the session in reverse order). With older glib version, the five users being inserted happened to return the order expected by the tests. With latest glib, due to a minor tweak in hashing strategy, the insertion leads to unsorted list leading to failed tests. In addition, GHashTable makes no guarantees about the stability of items when iterating multiple times. Since the algorithm is sensitive to order of users, it is best to return users in an order that is consistent over multiple calls and stable over insert/remove operations. This patch sorts the keys during iteration of users in the user table. Closes: gobby#22. Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Apparently, all the tests list users in the sorted order 1 to 5 and expect the algorithm to give priority accordingly when expecting the output. When the values are inserted into the user table, with earlier glib, the iteration order was always 1 to 5 (by chance) even though they were inserted 5 to 1. GHashTable makes no such promises. In the newer glib due to a minor tweak to the hash algorithm, this order is disrupted and the tests started to fail. Further, GHashTable also does not make any guarantees about consistent ordering when iterating multiple times. A possible solution seems to be to iterate the user table hash table in sorted order. I proposed fixes with two different approaches in #24 and #25. Please consider merging a fix soon and making a release. I would love to see infinoted return to Debian testing (and FreedomBox testing). |
infinoted has reached testing again as @pkern has imported the patches. This issue still needs an upstream release though. |
@pkern: you appear to have commit access (or had in 2017), would you mind merging the fixes? |
Forwarding Debian bug #935614:
The first session test fails with an error on Debian bullseye/sid (full build log:
The same version builds fine on Debian buster.
We could use some help in figuring out why the test fails.
The text was updated successfully, but these errors were encountered: