Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

chore: Expect event sink to match predicate. #223

Merged
merged 5 commits into from
May 29, 2024
Merged

Conversation

kinyoklion
Copy link
Member

@kinyoklion kinyoklion commented May 28, 2024

On mac the file data source receives extra file change notifications and fails intermittently. This adds an assert helper based on a predicate that allows checking multiple events.

This helper will likely need to be used on other tests as there are some similar intermittent failures with big segments.

@@ -148,9 +151,52 @@ public void ModifiedFileIsReloadedIfAutoUpdateIsOn()

file.SetContentFromPath(TestUtils.TestFilePath("segment-only.json"));

var newData = _updateSink.Inits.ExpectValue(TimeSpan.FromSeconds(5));

AssertJsonEqual(DataSetAsJson(ExpectedDataSetForSegmentOnlyFile(2)), DataSetAsJson(newData));
Copy link
Member Author

Choose a reason for hiding this comment

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

Cannot just do a JSON comparison if the version number is going to be incremented every time a change is detected.

Copy link
Member Author

Choose a reason for hiding this comment

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

This isn't pretty, but I want the test to stop failing.

@kinyoklion kinyoklion marked this pull request as ready for review May 28, 2024 22:13
@kinyoklion kinyoklion requested a review from a team May 28, 2024 22:13
@kinyoklion
Copy link
Member Author

This isn't the last flaky test. The contract tests fail sometimes, so I will sort that next in another PR.

@kinyoklion kinyoklion merged commit 3254dda into main May 29, 2024
7 checks passed
@kinyoklion kinyoklion deleted the rlamb/expect-predicate branch May 29, 2024 15:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants