`PG::UniqueViolation` transient errors in Spinach specs
As seen here: https://gitlab.com/gitlab-org/gitlab-ee/builds/14961275 we still experience this issue in Spinach specs.
By looking at the logs, it seems that the problem is in features/project/shortcuts.feature
.
I've tried the following patch locally and it seems to fix the issue (we've done a similar thing in features/steps/shared/diff_note.rb
:
diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb
index 4eef7aff21..8bae80a870 100644
--- a/features/steps/shared/active_tab.rb
+++ b/features/steps/shared/active_tab.rb
@@ -1,5 +1,10 @@
module SharedActiveTab
include Spinach::DSL
+ include WaitForAjax
+
+ after do
+ wait_for_ajax if javascript_test?
+ end
def ensure_active_main_tab(content)
expect(find('.layout-nav li.active')).to have_content(content)