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

Fix load construction unit test #1968

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

QuentinGruber
Copy link
Owner

@QuentinGruber QuentinGruber commented Feb 26, 2024


Generated summary (powered by Graphite)

TL;DR

This pull request fixes the issue where the order of loaded constructions was not consistent due to MongoDB's handling of data. It introduces a sorting mechanism based on the characterId to ensure the order is consistent.

What changed

The main change is in the worldSaveUnitTests function in the worlddatamanager.test.ts file. After loading the constructions, they are now sorted by characterId before being compared for equality. This ensures that the order of constructions is consistent, regardless of how MongoDB returns the data.

How to test

To test this change, run the unit tests for the worlddatamanager.test.ts file. The test should now pass, showing that the loaded constructions and the world constructions are equal, even if MongoDB returns the data in a different order.

Why make this change

This change is necessary to ensure that the tests for the worlddatamanager are reliable and consistent. Previously, the test could fail if MongoDB returned the data in a different order, even if the data was correct. By sorting the data before comparing it, we ensure that the test only fails if the data is incorrect, not if it is in a different order.

Copy link
Owner Author

Current dependencies on/for this PR:

This stack of pull requests is managed by Graphite.

@github-actions github-actions bot added the client-2016 About the 2016 client label Feb 26, 2024
@QuentinGruber QuentinGruber added this to the v0.34.0 milestone Feb 26, 2024
@QuentinGruber QuentinGruber linked an issue Feb 26, 2024 that may be closed by this pull request
@QuentinGruber QuentinGruber merged commit 28299be into dev Feb 26, 2024
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-2016 About the 2016 client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing structures after server crash/restart
1 participant