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

Adds tests to ensure context remains "stable" through multiple reloads #443

Merged
merged 2 commits into from
Apr 5, 2023

Conversation

bplatz
Copy link
Contributor

@bplatz bplatz commented Apr 5, 2023

@aaj3f was investigating an issue via http-api-gateway where after multiple transactions the default context seemed to revert back to the connection default.

We confirmed this behavior looking at the commit files written, and they do in fact loose all reference to the default context file.

I threw together these tests to attempt to replicate the issue, but they all pass. I figured they are good tests to have regardless.

@bplatz bplatz requested a review from a team April 5, 2023 19:38
@cap10morgan
Copy link
Contributor

Copy link
Contributor

@cap10morgan cap10morgan left a comment

Choose a reason for hiding this comment

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

Very minor indentation thing, but looks good to me! Always good to have more tests.


(deftest ^:integration default-context-stability-file
(with-tmp-dir storage-path
(let [conn @(fluree/connect
Copy link
Contributor

Choose a reason for hiding this comment

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

Small thing but it would be good to configure our editors to treat with-tmp-dir as a two-level indent form instead of an align-args form. So you would have this instead:

(with-tmp-dir storage-path
  (let ...))

Copy link
Contributor

Choose a reason for hiding this comment

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

In Cursive you can either do that by configuring the indent directly or by telling it to resolve this as one of the core with-... forms it already knows about from the "context actions" menu (right click on with-tmp-dir and select "Show Context Actions"). One of those might get it to understand that you're defining storage-path here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed!

@bplatz
Copy link
Contributor Author

bplatz commented Apr 5, 2023

@bplatz Might it be related to this change? https://github.com/fluree/db/pull/437/files#diff-a5569ed9d3dfd9a2bc3db76de1bc16f90dfa375e70099274139f8e24a8833cdaL420-R416

Agh... I think you are correct. I wrote the tests wrong, so this is testing the wrong thing. Let me correct them and see if they break.

@bplatz bplatz merged commit b0ce315 into main Apr 5, 2023
@bplatz bplatz deleted the feature/context-stability branch April 5, 2023 20:36
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