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 unreliable unit test #16145

Merged
merged 5 commits into from
May 25, 2024
Merged

Conversation

gvkries
Copy link
Contributor

@gvkries gvkries commented May 23, 2024

Fixes #16018.

// test is executing too fast, both blog entries may have the same CreatedUtc
// value and ordering becomes random. Because of this, we do not assert the order
// of the result.
Assert.Contains("Some sorta blogpost in a Query!", jsonArray.Select(node => node["displayText"]?.ToString()));
Copy link
Member

Choose a reason for hiding this comment

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

Can you save the result of jsonArray.Select(node => node["displayText"]?.ToString()) into a variable and use it in both lines?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, done!

@MikeAlhayek MikeAlhayek merged commit cab8dbd into OrchardCMS:main May 25, 2024
10 checks passed
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.

RecentBlogPostsQueryTests.ShouldListBlogPostWhenCallingAQuery is flaky
3 participants