Repository navigation
feat: redis based locking mechanism - #662
Conversation
RubenVerborgh
left a comment
There was a problem hiding this comment.
Going in the right direction, I like it!
Some nits; main thing missing is an integration test along the lines of https://github.com/solid/community-server/blob/594cf27696a7c8a59231b8e3e593089816459811/test/integration/SparqlStorage.test.ts, so we test with an actual Redis.
jvherweg
left a comment
There was a problem hiding this comment.
Mostly minor nits and some suggestions on how to improve testing (and make it easier). The other two non-review comments that were made are still relevant of course.
jvherweg
left a comment
There was a problem hiding this comment.
Is looking good to me. Most of the comments are small styling issues. The only concern still is the mocking of redlock. After that it should be ready to merge.
|
@BelgianNoise I added mocks in the latest commit. I had missed in my previous reviews that several private fields were also accessed in some tests so some of them had to be changed as well. I also made some changes to the locker code to make it easier to test. The main idea is that you should be able to test everything by testing how the behaviour of the class changes instead of a private field, and if something can only be tested by checking a private field then it might indicate that something is off there. The contents of the maps could have been tested by mocking the Map constructor but that isn't really necessary. The Redlock mock could also have been made more extensive to simulate the actual behaviour more closely but that would have required a bigger rewrite of the tests. Due to the changes there are some minor behaviour differences so do let me know if you see something that seems wrong (I guess we changed roles now 😄 ). |
I don't immediately see a problem, looks good to me. |
Ok, will merge and update the Redis issue then. |
No description provided.