Subject: Regression errors - database node

From: Dave Page <[email-masked]>
Date: Mon, 19 Sep 2016 16:52:06 +0100

Hi Navnath

I keep seeing the errors below when running tests. It seems to be
consistent on EPAS, but intermittent on PG. Any ideas what the issue
is? I'm fairly convinced it's a test issue not an actual problem.

2016-09-19 16:47:49,567:ERROR:STDERR:======================================================================
2016-09-19 16:47:49,568:ERROR:STDERR:ERROR: runTest
(pgadmin.browser.server_groups.servers.databases.tests.test_db_get.DatabasesGetTestCase)
2016-09-19 16:47:49,568:ERROR:STDERR:This function will fetch added
database. (Check Databases Node URL)
2016-09-19 16:47:49,568:ERROR:STDERR:----------------------------------------------------------------------
2016-09-19 16:47:49,568:ERROR:STDERR:Traceback (most recent call last):
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_get.py",
line 33, in runTest
2016-09-19 16:47:49,568:ERROR:STDERR:    self.db_id)
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/utils.py",
line 142, in verify_database
2016-09-19 16:47:49,568:ERROR:STDERR:    follow_redirects=True)
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 788, in post
2016-09-19 16:47:49,568:ERROR:STDERR:    return self.open(*args, **kw)
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
line 113, in open
2016-09-19 16:47:49,568:ERROR:STDERR:    follow_redirects=follow_redirects)
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 751, in open
2016-09-19 16:47:49,568:ERROR:STDERR:    response =
self.run_wsgi_app(environ, buffered=buffered)
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 668, in run_wsgi_app
2016-09-19 16:47:49,568:ERROR:STDERR:    rv =
run_wsgi_app(self.application, environ, buffered=buffered)
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 871, in run_wsgi_app
2016-09-19 16:47:49,568:ERROR:STDERR:    app_rv = app(environ, start_response)
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 2000, in __call__
2016-09-19 16:47:49,568:ERROR:STDERR:    return self.wsgi_app(environ,
start_response)
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1991, in wsgi_app
2016-09-19 16:47:49,568:ERROR:STDERR:    response =
self.make_response(self.handle_exception(e))
2016-09-19 16:47:49,568:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1567, in handle_exception
2016-09-19 16:47:49,568:ERROR:STDERR:    reraise(exc_type, exc_value, tb)
2016-09-19 16:47:49,569:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1988, in wsgi_app
2016-09-19 16:47:49,569:ERROR:STDERR:    response = self.full_dispatch_request()
2016-09-19 16:47:49,569:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1641, in full_dispatch_request
2016-09-19 16:47:49,569:ERROR:STDERR:    rv = self.handle_user_exception(e)
2016-09-19 16:47:49,569:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1544, in handle_user_exception
2016-09-19 16:47:49,569:ERROR:STDERR:    reraise(exc_type, exc_value, tb)
2016-09-19 16:47:49,569:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1639, in full_dispatch_request
2016-09-19 16:47:49,569:ERROR:STDERR:    rv = self.dispatch_request()
2016-09-19 16:47:49,569:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1625, in dispatch_request
2016-09-19 16:47:49,569:ERROR:STDERR:    return
self.view_functions[rule.endpoint](**req.view_args)
2016-09-19 16:47:49,569:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
line 84, in view
2016-09-19 16:47:49,569:ERROR:STDERR:    return
self.dispatch_request(*args, **kwargs)
2016-09-19 16:47:49,569:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line 235, in
dispatch_request
2016-09-19 16:47:49,569:ERROR:STDERR:    return method(*args, **kwargs)
2016-09-19 16:47:49,569:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
line 364, in connect
2016-09-19 16:47:49,569:ERROR:STDERR:    conn =
manager.connection(did=did, auto_reconnect=True)
2016-09-19 16:47:49,569:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py",
line 1447, in connection
2016-09-19 16:47:49,569:ERROR:STDERR:    "Couldn't find the specified database."
2016-09-19 16:47:49,569:ERROR:STDERR:Exception: Couldn't find the
specified database.
2016-09-19 16:47:49,569:ERROR:STDERR:======================================================================
2016-09-19 16:47:49,569:ERROR:STDERR:ERROR: runTest
(pgadmin.browser.server_groups.servers.databases.tests.test_db_put.DatabasesUpdateTestCase)
2016-09-19 16:47:49,569:ERROR:STDERR:This function will update the
comments field of database. (Check Databases Node)
2016-09-19 16:47:49,569:ERROR:STDERR:----------------------------------------------------------------------
2016-09-19 16:47:49,570:ERROR:STDERR:Traceback (most recent call last):
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_put.py",
line 37, in runTest
2016-09-19 16:47:49,570:ERROR:STDERR:    db_id)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/utils.py",
line 142, in verify_database
2016-09-19 16:47:49,570:ERROR:STDERR:    follow_redirects=True)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 788, in post
2016-09-19 16:47:49,570:ERROR:STDERR:    return self.open(*args, **kw)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/testing.py",
line 113, in open
2016-09-19 16:47:49,570:ERROR:STDERR:    follow_redirects=follow_redirects)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 751, in open
2016-09-19 16:47:49,570:ERROR:STDERR:    response =
self.run_wsgi_app(environ, buffered=buffered)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 668, in run_wsgi_app
2016-09-19 16:47:49,570:ERROR:STDERR:    rv =
run_wsgi_app(self.application, environ, buffered=buffered)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/werkzeug/test.py",
line 871, in run_wsgi_app
2016-09-19 16:47:49,570:ERROR:STDERR:    app_rv = app(environ, start_response)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 2000, in __call__
2016-09-19 16:47:49,570:ERROR:STDERR:    return self.wsgi_app(environ,
start_response)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1991, in wsgi_app
2016-09-19 16:47:49,570:ERROR:STDERR:    response =
self.make_response(self.handle_exception(e))
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1567, in handle_exception
2016-09-19 16:47:49,570:ERROR:STDERR:    reraise(exc_type, exc_value, tb)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1988, in wsgi_app
2016-09-19 16:47:49,570:ERROR:STDERR:    response = self.full_dispatch_request()
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1641, in full_dispatch_request
2016-09-19 16:47:49,570:ERROR:STDERR:    rv = self.handle_user_exception(e)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1544, in handle_user_exception
2016-09-19 16:47:49,570:ERROR:STDERR:    reraise(exc_type, exc_value, tb)
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1639, in full_dispatch_request
2016-09-19 16:47:49,570:ERROR:STDERR:    rv = self.dispatch_request()
2016-09-19 16:47:49,570:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/app.py",
line 1625, in dispatch_request
2016-09-19 16:47:49,571:ERROR:STDERR:    return
self.view_functions[rule.endpoint](**req.view_args)
2016-09-19 16:47:49,571:ERROR:STDERR:  File
"/Users/dpage/.virtualenvs/pgadmin4/lib/python2.7/site-packages/flask/views.py",
line 84, in view
2016-09-19 16:47:49,571:ERROR:STDERR:    return
self.dispatch_request(*args, **kwargs)
2016-09-19 16:47:49,571:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/utils.py", line 235, in
dispatch_request
2016-09-19 16:47:49,571:ERROR:STDERR:    return method(*args, **kwargs)
2016-09-19 16:47:49,571:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/__init__.py",
line 364, in connect
2016-09-19 16:47:49,571:ERROR:STDERR:    conn =
manager.connection(did=did, auto_reconnect=True)
2016-09-19 16:47:49,571:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/utils/driver/psycopg2/__init__.py",
line 1447, in connection
2016-09-19 16:47:49,571:ERROR:STDERR:    "Couldn't find the specified database."
2016-09-19 16:47:49,571:ERROR:STDERR:Exception: Couldn't find the
specified database.
2016-09-19 16:47:49,571:ERROR:STDERR:======================================================================
2016-09-19 16:47:49,571:ERROR:STDERR:FAIL: runTest
(pgadmin.browser.server_groups.servers.databases.tests.test_db_delete.DatabaseDeleteTestCase)
2016-09-19 16:47:49,571:ERROR:STDERR:This function will delete the
database. (Check Databases Node URL)
2016-09-19 16:47:49,571:ERROR:STDERR:----------------------------------------------------------------------
2016-09-19 16:47:49,571:ERROR:STDERR:Traceback (most recent call last):
2016-09-19 16:47:49,571:ERROR:STDERR:  File
"/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups/servers/databases/tests/test_db_delete.py",
line 38, in runTest
2016-09-19 16:47:49,571:ERROR:STDERR:
self.assertEquals(response.status_code, 200)
2016-09-19 16:47:49,571:ERROR:STDERR:AssertionError: 410 != 200
2016-09-19 16:47:49,571:ERROR:STDERR:----------------------------------------------------------------------
2016-09-19 16:47:49,571:ERROR:STDERR:Ran 25 tests in 12.664s
2016-09-19 16:47:49,571:ERROR:STDERR:FAILED
2016-09-19 16:47:49,571:ERROR:STDERR: (failures=1, errors=2)
2016-09-19 16:47:50,033:ERROR:STDERR:
2016-09-19 16:47:50,033:ERROR:STDERR:Test Result Summary
2016-09-19 16:47:50,033:ERROR:STDERR:============================
2016-09-19 16:47:50,033:ERROR:STDERR:Regression - EPAS 9.5: 22 tests
passed, 3 tests failed :
2016-09-19 16:47:50,033:ERROR:STDERR:  DatabaseDeleteTestCase
2016-09-19 16:47:50,033:ERROR:STDERR:  DatabasesGetTestCase
2016-09-19 16:47:50,033:ERROR:STDERR:  DatabasesUpdateTestCase
2016-09-19 16:47:50,033:ERROR:STDERR:Regression - PG 9.5: 22 tests
passed, 3 tests failed :
2016-09-19 16:47:50,033:ERROR:STDERR:  DatabaseDeleteTestCase
2016-09-19 16:47:50,033:ERROR:STDERR:  DatabasesGetTestCase
2016-09-19 16:47:50,033:ERROR:STDERR:  DatabasesUpdateTestCase
2016-09-19 16:47:50,034:ERROR:STDERR:Regression - PG 9.4: 25 tests
passed, 0 tests failed
2016-09-19 16:47:50,034:ERROR:STDERR:============================

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

-- 
Sent via pgadmin-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Navnath Gadakh <[email-masked]>
Date: Wed, 21 Sep 2016 16:46:08 +0530

Hi Dave,
     After a long debugging of these errors with Harshal, we found the
issue is in the handling pyscopg connection. Need to add some code in the
pyscopg connection manager as per Harshal.

For more details, Please refer RM #1720.
<https://redmine.postgresql.org/issues/1720>

@Harshal, thanks for the time invested.

Thanks.

On Mon, Sep 19, 2016 at 9:22 PM, Dave Page <[email-masked]> wrote:

> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_
> groups/servers/databases/tests/test_db_get.py",
> line 33, in runTest
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_
> groups/servers/databases/tests/utils.py",
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_
> groups/servers/databases/tests/test_db_put.py",
> line 37, in runTest
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_
> groups/servers/databases/tests/utils.py",
> self.full_dispatch_request()
> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_
> groups/servers/databases/tests/test_db_delete.py",
> line 38, in runTest

-- 
Regards,
Navnath

---

From: Navnath Gadakh <[email-masked]>
Date: Thu, 22 Sep 2016 17:06:51 +0530

Hi Dave,
       Please find the attached revised patch for regression errors which
we faced.
Firstly,  apply patch for RM#1720(Harshal worked on this) and then apply
this patch. There is some code change in test suite due to code
modification in dev side.

Note: Run test suite only for server or database node.

Thanks.

On Wed, Sep 21, 2016 at 4:46 PM, Navnath Gadakh <
[email-masked]> wrote:

>> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups
>> /servers/databases/tests/test_db_get.py",
>> line 33, in runTest
>> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups
>> /servers/databases/tests/test_db_put.py",
>> line 37, in runTest
>> self.handle_user_exception(e)
>> "/Users/dpage/git/pgadmin4/web/pgadmin/browser/server_groups
>> /servers/databases/tests/test_db_delete.py",
>> line 38, in runTest

-- 
Regards,
Navnath

---

From: Dave Page <[email-masked]>
Date: Thu, 22 Sep 2016 13:00:16 +0100

Thanks, applied.

On Thu, Sep 22, 2016 at 12:36 PM, Navnath Gadakh
<[email-masked]> wrote:
> Hi Dave,
>        Please find the attached revised patch for regression errors which we
> faced.
> this patch. There is some code change in test suite due to code modification
> in dev side.
>
> On Wed, Sep 21, 2016 at 4:46 PM, Navnath Gadakh
> <[email-masked]> wrote:
>>
>> Hi Dave,
>>> 2016-09-19
>>> 16:47:49,567:ERROR:STDERR:======================================================================
>>> 2016-09-19
>>> 16:47:49,568:ERROR:STDERR:----------------------------------------------------------------------
>>> 2016-09-19
>>> 16:47:49,569:ERROR:STDERR:======================================================================
>>> 2016-09-19
>>> 16:47:49,569:ERROR:STDERR:----------------------------------------------------------------------
>>> 2016-09-19
>>> 16:47:49,571:ERROR:STDERR:======================================================================
>>> 2016-09-19
>>> 16:47:49,571:ERROR:STDERR:----------------------------------------------------------------------
>>> 2016-09-19
>>> 16:47:49,571:ERROR:STDERR:----------------------------------------------------------------------