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

Try to avoid exceptions after flaggable tests #4350

Merged
merged 1 commit into from
Feb 9, 2021
Merged

Conversation

javierm
Copy link
Member

@javierm javierm commented Feb 8, 2021

References

Failure:

  1) Commenting legislation questions Merged comment threads View
comments of annotations in an included range
     Failure/Error: count: annotation.comments.roots.count) %>

     ActionView::Template::Error:
       PG::ProtocolViolation: ERROR:  bind message supplies 0
parameters, but prepared statement "" requires 2
       : SELECT COUNT(*) FROM "comments" WHERE "comments"."hidden_at" IS
NULL AND "comments"."commentable_id" = $1 AND
"comments"."commentable_type" = $2 AND "comments"."ancestry" IS NULL

Objectives

  • Run expectations from the user's point of view in system tests
  • Try to reduce the number of PG::ProtocolViolation we're getting on Github Actions

Notes

Debugging shows the test which failed run right after the flaggable specs. There's a chance these exceptions take place because the test is accessing the database after the browser (chromedriver) process has already accessed the database.

This is just an attempt at fixing the issue; I don't know whether these changes will fix it since I've only seen this exception on Github Actions (never on my machine). Worst case scenario, we're encouraging good practices of system tests: test things from the user's point of view.

We had one exception running test suite [1]:

```
  1) Commenting legislation questions Merged comment threads View
comments of annotations in an included range
     Failure/Error: count: annotation.comments.roots.count) %>

     ActionView::Template::Error:
       PG::ProtocolViolation: ERROR:  bind message supplies 0
parameters, but prepared statement "" requires 2
       : SELECT COUNT(*) FROM "comments" WHERE "comments"."hidden_at" IS
NULL AND "comments"."commentable_id" = $1 AND
"comments"."commentable_type" = $2 AND "comments"."ancestry" IS NULL
```

Debugging shows this test was run right after the flaggable specs.
There's a chance these exceptions take place because the test is
accessing the database after the browser (chromedriver) process has
already accessed the database.

This is just an attempt at fixing the issue; I don't know whether these
changes will fix it since I've only seen this exception on Github
Actions (never on my machine). Worst case scenario, we're encouraging
good practices of system tests: test things from the user's point of
view.

[1] https://github.com/consul/consul/runs/1856245992
@javierm javierm self-assigned this Feb 8, 2021
@javierm javierm added this to Reviewing in Consul Democracy via automation Feb 8, 2021
@taitus taitus self-assigned this Feb 9, 2021
Consul Democracy automation moved this from Reviewing to Testing Feb 9, 2021
@javierm javierm merged commit a3675a8 into master Feb 9, 2021
Consul Democracy automation moved this from Testing to Release 1.3.0 Feb 9, 2021
@javierm javierm deleted the flaggable_specs branch February 9, 2021 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants