Skip to content
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

a few more tests for book #1275

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

a few more tests for book #1275

wants to merge 5 commits into from

Conversation

nsreed
Copy link

@nsreed nsreed commented Aug 30, 2022

A few new tests and a little more test tooling for book.

A few failures that are interesting:

  • Overwriting a word creates a duplicate
  • ' and | in the word fails
  • Words sharing a page/file cannot be retrieved using page.book(word)

I believe these bugs encompass most of the failures in the tests, and I've tried to add FIXMEs in the tests that most effectively illustrate them. Some of the TODOs are for me. Again, I plan on cleaning this file up at some point but the test failures aren't doing much good sitting on my machine and I'm not 100% sure when I'll be able to get back to it.

@amark
Copy link
Owner

amark commented Aug 31, 2022

I saw this with @prometheus also, so can confirm the first 2 also. I don't understand the 3rd thing tho?

Note to others: Book + the RAD updates are being coded on a "rebuild the plane while flying" path. We're first testing whether parts "fit" together, even when we know they don't work. If the scaffold fits, it does nothing / behaves incorrectly at first, but then we filling in the engine. Its like replacing a black box system.

@nsreed
Copy link
Author

nsreed commented Aug 31, 2022

An approximate summary of the third issue:

rad('a', 'a');
rad('b', 'b'); // NOTE: I am waiting for each write callback before proceeding, this is just more brief
rad('a', cb); // retrieves 'a' correctly
rad('b', cb); // retrieves undefined

If I use a new rad for the reads, the values are retrieved correctly.

rad('a', 'a');
rad('b', 'b');
rad = Radisk(opt);
rad('a', cb); // retrieves 'a' correctly
rad('b', cb); // retrieves 'b' correctly

Or, if the values are large enough to split into their own file, they are both retrieved correctly.

rad('a', ''.padEnd(1000000, 'a'));
rad('b', ''.padEnd(1000000, 'b'));
rad('a', cb); // retrieves 'aaaaaa....' correctly
rad('b', cb); // retrieves 'bbbbb....' correctly

So it seems like the in-memory data vs. the on-disk data have some disagreements, but surprisingly to me the on-disk data is more correct.

@amark
Copy link
Owner

amark commented Aug 31, 2022

oof.

@nsreed
Copy link
Author

nsreed commented Aug 31, 2022

Not sure if it matters, but might be important:

rad('a', 'a');
rad = Radisk(opt); // create a new RAD instance for second write
rad('b', 'b');
rad('a', cb); // retrieves 'a' correctly
rad('b', cb); // retrieves undefined

Thought I might be able to get the second write to work by re-reading what's on disk, but no.

@amark
Copy link
Owner

amark commented Sep 27, 2022

I'm back from a bunch of conferences... let's resume / catch up. DM me on twitter some times to do a screen call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants