-
Notifications
You must be signed in to change notification settings - Fork 184
[v7r2] Fix JSON encoding of RMS requests #5111
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
Conversation
|
Use assertRaises https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertRaises to notice when tests are broken? |
|
I modified the tests to use |
|
As we discussed, these tests should just be removed, they do not make sense since we removed this type checking logic in 2014. As for the json stuff. I am not convinced this is the correct thing to do. I suspect we are going to run into this issue with every DB that has |
|
Actually, thinking of it again.... it sort of boils down to the same issue as with the CS, so should we apply the same trick, that is |
|
we could do it in DIRAC/src/DIRAC/Core/Utilities/JEncode.py Lines 100 to 101 in 54d8988
Do you see any downside to it ? |
I think I agree with you, specifically:
My only question would be how we deal with the actual upgrade/migration and I suspect it's invasive enough that it is something for v7r3. |
These checks were removed in 2014 and won't be re-added. The old tests used to silently fail due to the "else" branch of the "try..catch" not being implemented
|
Converting We should indeed get ride of the Of course, the problem will always be the compatibility of old clients. Though for that we could finally make use of the I somehow have the feeling that whatever modification we want to do with BLOB (in any DB), we are better of doing it BEFORE running actual python3 code |
|
I think the discussions here should be converted into a issue, and at the same time merge this PR, because as it is, for existing installations, and for v7r2, it looks just fine. |
|
Done, if there are no further comments shall we get this merged so we can unblock the LHCbDIRAC CI? |
|
yep ! |
It turns out #5091 isn't the end of the story of encoding issues in the RMS. The LHCbDIRAC unit tests showed that the
toJSONmethods are broken due tobytesbeing an invalid type in JSON. I don't like it but 3ce9622 seems to be a good enough solution with the view to eventually removing the use ofDEncode.As part of this I modernised the tests to use
pytest, it might be easier to review if you ignore the first commit. While doing this I noticed that many of the tests of the form:are actually broken as the expected exception isn't raised. I've commented them out in 1c2b528 while we decide what to do about them.
BEGINRELEASENOTES
*RequestManagement
FIX: Fix JSON encoding of RMS requests
ENDRELEASENOTES