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

test: add test case for backup feature #1353

Closed
wants to merge 1 commit into from
Closed

Conversation

kilrau
Copy link
Contributor

@kilrau kilrau commented Dec 18, 2019

Tests for #1032. Some dependencies might have to be updated to make Travis pass for this.

@kilrau kilrau added the P1 top priority label Dec 18, 2019
@kilrau kilrau requested a review from sangaman December 18, 2019 10:22
Copy link
Collaborator

@sangaman sangaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests are failing due to RangeError: Maximum call stack size exceeded while writing files and it's not clear to me what's causing it. It doesn't happen for me locally so it's not easy to pinpoint. If it's not apparent what's causing it for you either, I can help some more with debugging it.

fs.rmdirSync(dir);
};

const wait = (ms: number) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a utils setTimeoutPromise for this you can import and use in the same way instead of this function.

);

// Wait 100ms to make sure the file watcher handled the new file
await wait(100);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice here to be able to actually be notified when the new file update has been handled, instead of waiting a fixed amount of time. I figure the easiest way to do that would be to make the Backup class extend EventEmitter, then add an event for when a new backup is written and emit it after or at the end of the writeBackup call along with an identifier (either client or dbpath). Then you can listen for that here and elsewhere wait is being used.

@sangaman
Copy link
Collaborator

Combining this PR with #1352 because I want to ensure this test case passes with the changes from that PR.

@sangaman sangaman closed this Dec 19, 2019
@michael1011 michael1011 deleted the channel-backups-test branch December 20, 2019 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 top priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants