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

Integration tests don't cleanup their Postgres databases #3268

Closed
2opremio opened this issue Dec 7, 2020 · 3 comments · Fixed by #4185
Closed

Integration tests don't cleanup their Postgres databases #3268

2opremio opened this issue Dec 7, 2020 · 3 comments · Fixed by #4185
Assignees

Comments

@2opremio
Copy link
Contributor

2opremio commented Dec 7, 2020

While writing #3267 I found out that the integration tests are not dropping their dedicated Horizon Postgres database.

I tried fixing it (look at the TODOs in the code from the PR above) but it turns out that Horizon's App leaves open sessions behind .... even after closing it (leading to database is being accessed by other users errors).

This may indicate that Horizon is leaking DB connections, so we should look into it.

@bartekn
Copy link
Contributor

bartekn commented Jun 28, 2021

Possibly fixed?

@2opremio
Copy link
Contributor Author

I will test this out.

@2opremio
Copy link
Contributor Author

It's still broken, I get this error upon uncomenting the postgres.Close() call.

=== CONT  TestProtocol16Basics
    db.go:108: 
        	Error Trace:	db.go:108
        	            				db.go:135
        	            				db.go:53
        	            				integration.go:181
        	            				integration.go:170
        	            				once.go:68
        	            				once.go:59
        	            				integration.go:167
        	            				testing.go:901
        	            				testing.go:1007
        	            				testing.go:1187
        	Error:      	Received unexpected error:
        	            	pq: database "test_b9831a09ca15" is being accessed by other users
        	Test:       	TestProtocol16Basics
--- FAIL: TestProtocol16Basics (26.89s)
=== RUN   TestProtocol16Basics/Sanity

The test passes when the call is commented.

@sreuland sreuland self-assigned this Jan 3, 2022
sreuland added a commit to sreuland/go that referenced this issue Jan 18, 2022
sreuland added a commit to sreuland/go that referenced this issue Jan 18, 2022
sreuland added a commit to sreuland/go that referenced this issue Feb 10, 2022
sreuland added a commit to sreuland/go that referenced this issue Aug 7, 2022
sreuland added a commit to sreuland/go that referenced this issue Aug 7, 2022
sreuland added a commit to sreuland/go that referenced this issue Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants