Skip to content

Fix undo persistence test#2741

Merged
raineorshine merged 3 commits intocybersemics:mainfrom
mstrofbass:fix-undo-redo-tests2-2145
Dec 28, 2024
Merged

Fix undo persistence test#2741
raineorshine merged 3 commits intocybersemics:mainfrom
mstrofbass:fix-undo-redo-tests2-2145

Conversation

@mstrofbass
Copy link
Contributor

This fixes the remaining undo/redo test.

Problem #1: It looks like we must use fake timers if we want the store state to be updated based on database operations (e.g., if we use initialize() to reload the state). I think this is because the thoughtspace operations are asynchronous and don't call the store operations prior to the test ending. (I'm not sure why we didn't get other errors that made this clear.)

Problem #2: There appears to be some store state that isn't cleaned up between tests that persists from the previous tests and breaks this one. The other tests probably aren't effected because they all call createTestStore, which presumably creates a brand new store.

This second issue is somewhat ancillary but might come up when mixing tests that do/don't require createTestStore and should figure out the root cause at some point. My initial guess is that we'll just need to figure out a way reverse whatever happens in createTestStore.

Closes #2145

Copy link
Contributor

@raineorshine raineorshine left a comment

Choose a reason for hiding this comment

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

Great, thanks for the explanation. I will merge this as a solution for #2145 and we can try to spot the deeper issue with test store isolation.

@raineorshine raineorshine merged commit 1de83fc into cybersemics:main Dec 28, 2024
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.

Fix undo-redo tests

2 participants