Add eqc trim tests to machi_file_proxy #35
Loading…
Reference in a new issue
No description provided.
Delete branch "ku/making-file-proxy-spec"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
QuickCheck took me to the maze of my code.
csum_table:all_trimmed/3
says(I guess
Left
andRight
here are both offset (instead of length) only from the variable names)...And then,
file_proxy:handle_call({trim, ...)
calls it asMaking testing time to 600 sec, following errors happened.
Changed a parameter to make more contention between
planned_writes
and
planned_trims
as [1]Then got an error (longer version [2]):
[1] https://gist.github.com/shino/7e77c2fac3af4e3a7c85
[2] https://gist.github.com/shino/ef91a984c5582d09f963
It looks file_proxy is behaving correctly. I think the verification is wrong.
Self comment to the above diff. It uses shorter intervals and makes each intervals filled. It will be useful to generate overlapped
planned_writes
andplanned_trims
but, downside is it does not have wide variety.I think @kuenishi is right - the proxy is behaving correctly and the eqc test is not validating this case properly.
file_proxy returns
{error, written}
when a client tried to write to a written chunk (same size and offset, regardless of bytes and checksum), butwrite_ok
believes it's okay if size and offset are exactly same as already written chunk.Test passed for several runs, diff looks nice 👍
Feel free to merge after one tiny comment above ⛳
Comments outside of this RP, just for future note, not mandatory for this PR to be merged.
read_args
usesoffset()
, which likely reterns < 1024@shino "Are filenames in PB high clients string()?" I would like to keep file names as
binary()
in all code except the PB interface.@slfritchie May I ask you a question, why use different types?
Hrm, well, all of the library code is assuming a binary(). But the PB definition file uses "string", which the PB compiler converts to & from list()/string(). Since our conversation a week (?) or so ago in the office about valid char types for filenames, using a
bytes
type in the PB definition feels to me to be too big