-
Notifications
You must be signed in to change notification settings - Fork 3
ci: merge staging to master #71
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
Pipeline Attempt on 598993155 for 01f44a1 https://gitlab.com/MatrixAI/open-source/js-encryptedfs/-/pipelines/598993155 |
👇 Click on the image for a new way to code review
Legend |
Pipeline Attempt on 599061810 for ad2f42e https://gitlab.com/MatrixAI/open-source/js-encryptedfs/-/pipelines/599061810 |
Ok there's another concurrency non-determinism. This time caused by a slower write while there is a write stream. It's quite confusing. But this is my theory. We have a write stream that writes 10 chunks of
Now we also have an atomic call to a duplicated FD but that which starts at position 0. It writes 25 characters of The test currently expects the 25 characters to be written atomically. Therefore the test thinks the end result is either one of these:
But the problem with this expectation is that, the former is true if the B write occurred first, and then A writes started. The latter can occur when A writes complete, then B write starts. But if B write starts in the middle of A writes. Then we would get a mixed output. This is because:
Hence is why we have:
Now this could also change if the B writes occurs after the 2nd chunk. In that case we should use The reason why this is quite non-deterministic is because there are 2 levels of asynchronicity here. The ones involving But the end result is that the B writes can occur at any point in time between the atomic A writes. This is the same problem as the previous problem, but it wasn't as clear, because B writes starting from position 0, whereas A writes are in sequence. |
So the solution could be to strictly control the concurrency, but that doesn't allow our test to be robust. A robust test here should instead have a predicate that allows any of the possible permutations of the output. That being of all As, or any number of chunks of B based on the chunk size of A, up to 5 chunks (the length of B divided by the chunk size of A). |
…cryptedFS.createWriteStream`
This has been resolved with a more robust regex check. I suspect more of these bugs are lurking in the tests. |
Pipeline Attempt on 599151439 for a70d4c4 https://gitlab.com/MatrixAI/open-source/js-encryptedfs/-/pipelines/599151439 |
Pipeline Attempt on 599152359 for 92efef0 https://gitlab.com/MatrixAI/open-source/js-encryptedfs/-/pipelines/599152359 |
Pipeline Succeeded on 599152359 for 92efef0 https://gitlab.com/MatrixAI/open-source/js-encryptedfs/-/pipelines/599152359 |
This is an automatic PR generated by the pipeline CI/CD. This will be automatically fast-forward merged if successful.