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

Proposed pref test fix #5470

Merged
merged 3 commits into from
Jan 27, 2025
Merged

Proposed pref test fix #5470

merged 3 commits into from
Jan 27, 2025

Conversation

andydotxyz
Copy link
Member

The new async way of working with prefs is not OK with the test system not having complete safety of thread handling.
So take a round trip to ensure it.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@coveralls
Copy link

coveralls commented Jan 26, 2025

Coverage Status

coverage: 59.117% (+0.02%) from 59.094%
when pulling efd6f41 on andydotxyz:fix/preftest
into 093b53e on fyne-io:develop.

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

If you remove the wait group and use fyne.DoAndWait() you should get the same result. However, in this case I think we should rename the test because with this change it no longer actually tests any races but just that we get the right object (which also is a bit strange given that we add no other objects).

@andydotxyz
Copy link
Member Author

(which also is a bit strange given that we add no other objects).

Because if it finds nothing another is created.
The reason this test fails is because there are lots of different instances created instead of just 1.

@andydotxyz
Copy link
Member Author

If you remove the wait group and use fyne.DoAndWait() you should get the same result. However, in this case I think we should rename the test because with this change it no longer actually tests any races

Which is why I didn't do that approach - instead spawning lots of "async" fyne.Do calls as a rough approximation of what it was doing before...

@andydotxyz andydotxyz merged commit 7bfcab6 into fyne-io:develop Jan 27, 2025
11 checks passed
@andydotxyz andydotxyz deleted the fix/preftest branch January 27, 2025 07:50
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.

3 participants