Skip to content

Fix flaky spec in autocomplete#13901

Merged
andreslucena merged 4 commits intodevelopfrom
fix/attempt-to-fix-flaky
Jan 23, 2025
Merged

Fix flaky spec in autocomplete#13901
andreslucena merged 4 commits intodevelopfrom
fix/attempt-to-fix-flaky

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu commented Jan 22, 2025

🎩 What? Why?

While running the specs, we noticed that from time to time, we get some random failures on spec/lib/map/autocomplete_spec.rb.
image

While investigating, i have reached in Decidim::Map::Autocoplete::FormBuilder module, where the method geocoding_field can return a plain text field if the autocomplete utility is not properly configured.

def geocoding_field(attribute, options = {}, geocoding_options = {})
@autocomplete_utility ||= Decidim::Map.autocomplete(
organization: @template.current_organization
)
return text_field(attribute, options) unless @autocomplete_utility
# Decidim::Map::Autocomplete::Builder
builder = @autocomplete_utility.create_builder(
@template,
geocoding_options
)
options = merge_geocoding_options(attribute, options)
field(attribute, options) do |opts|
builder.geocoding_field(
@object_name,
attribute,
opts
)
end
end

Testing

  1. This is kind of a test that is impossible to test locally, by just running the file, as the issue is being generated by runtime map configuration that is not coming from this file.
  2. You can see in the pipeline that the spec has not been failing for 10 times while i have tested. ( please note the pipeline was still marked as failing as at the same time the download flacky spec kicked in, and i did not bother to fix )

📷 Screenshots

Please add screenshots of the changes you are proposing
Description

♥️ Thank you!

@alecslupu alecslupu added flaky spec type: fix PRs that implement a fix for a bug labels Jan 22, 2025
github-actions[bot]
github-actions bot previously approved these changes Jan 22, 2025
github-actions[bot]
github-actions bot previously approved these changes Jan 22, 2025
github-actions[bot]
github-actions bot previously approved these changes Jan 22, 2025
github-actions[bot]
github-actions bot previously approved these changes Jan 22, 2025
@andreslucena
Copy link
Copy Markdown
Member

Attempt - decidim-core/lib/decidim/map/autocomplete.rb

yoda

@alecslupu alecslupu changed the title Identify the Flacky spec Flacky spec on autocomplete Jan 23, 2025
@alecslupu
Copy link
Copy Markdown
Contributor Author

alecslupu commented Jan 23, 2025

Attempt - decidim-core/lib/decidim/map/autocomplete.rb

@alecslupu alecslupu marked this pull request as ready for review January 23, 2025 08:29
@alecslupu alecslupu changed the title Flacky spec on autocomplete Fix Flacky spec on autocomplete Jan 23, 2025
@andreslucena andreslucena changed the title Fix Flacky spec on autocomplete Fix flaky spec in autocomplete Jan 23, 2025
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

I see lots of failures, but they come from the DownloadYourData feature, so we can ignore them:

Screenshot of the failures on this workflow

@andreslucena andreslucena merged commit b5c745f into develop Jan 23, 2025
@andreslucena andreslucena deleted the fix/attempt-to-fix-flaky branch January 23, 2025 10:50
@alecslupu alecslupu added release: v0.28 Issues or PRs that need to be tackled for v0.28 release: v0.29 Issues or PRs that need to be tackled for v0.29 labels Jan 23, 2025
entantoencuanto added a commit that referenced this pull request Jan 24, 2025
* develop: (30 commits)
  Change hardcoded english in seeds (#13917)
  Allow importing accountability results from a Proposals component (#13817)
  Remove user interests (#13910)
  Move remaining categories from some resources to taxonomies (#13838)
  Fix translation issue on import projects mailer (#13894)
  Update DownloadYourData exports for decidim-debates (#13895)
  Allow admins to publish the questions' answers in surveys (#13786)
  Fix flaky spec in autocomplete (#13901)
  Refine taxonomy filters (part 2) (#13725)
  Fix single attachment with title (#13795)
  Fix incorrect breadcrumb encoding on mobile and tablet (#13891)
  Add string for unpublish survey admin log message (#13890)
  Fix ux meeting date location (#13872)
  New Crowdin updates (#13767)
  Fix deleted user error in schema (#13681)
  Remove assembly types from user interaction (#13881)
  Remove participatory process types from user interaction (#13880)
  Lock concurrent-ruby to 1.3.4 (#13879)
  Fix taxonomy serialization for export/imports (#13857)
  Adjust form upload label changes (#13836)
  ...
antopalidi pushed a commit to openpoke/decidim that referenced this pull request Feb 12, 2025
* Identify the Flacky spec

* Attempt to fix the map

* Revert logging

* Fix geocoding
andreslucena pushed a commit that referenced this pull request Mar 3, 2025
* Identify the Flacky spec

* Attempt to fix the map

* Revert logging

* Fix geocoding
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flaky spec module: core release: v0.28 Issues or PRs that need to be tackled for v0.28 release: v0.29 Issues or PRs that need to be tackled for v0.29 type: fix PRs that implement a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants