antidote
antidote copied to clipboard
Wrong documentation of testcase `singledc/clocksi_SUITE:clocksi_test_read_wait`
The documentation of the test states
The following function tests that ClockSI does not read values inserted by a tx with higher commit timestamp than the snapshot time of the reading tx.
However, the testcase actually checks that the updated value is read.
This was different in the original version of the test: https://github.com/AntidoteDB/antidote/commit/0ad34d5991a7ad77e36efe76cba0f86ea22576cd
So maybe we introduced a bug and just changed the test case to fit it? The value was changed in https://github.com/AntidoteDB/antidote/commit/808170ee2e72a7f6e3f58605506b232ab1aff062#diff-af4a574965e2bea36840415849262ec4R179
Maybe someone with knowledge of the protocol (@bieniusa ?) can clarify this.
I think the documentation is wrong here. If commitTime of T_1 < snapshotTime of T_2, the read in T_2 should return the value written in T_1, i.e. the incremented one. This means that T_2 might need to wait till T_1 committed as indicated by the name of the test case.
We should add the comparison of times as an assert. Also, if possible, let's try to get rid of these sleeps, it seems to indicate that the tests are nondeterministic. The original test is.... buggy.