[pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

[pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

Akshay Joshi
Hi Hackers,

Attached is the patch to capture the notification from psycopg2 and displayed it in "Messages" tab of query tool. Added feature test to cover this scenario.

Refer Notification.png file to how it looks in "Messages" tab. Please review it.

--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246

Notification.png (113K) Download Attachment
RM_3204.patch (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

Joao De Almeida Pereira
Hi Akshay,

This patch is flaky; it doesn't always pass the tests in our pipeline.

======================================================================
ERROR: runTest (pgadmin.feature_tests.query_tool_tests.QueryToolFeatureTest)
Query tool feature test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/build/5988fb0a/pgadmin-repo/web/pgadmin/feature_tests/query_tool_tests.py", line 101, in runTest
self._query_tool_notify_statements()
File "/tmp/build/5988fb0a/pgadmin-repo/web/pgadmin/feature_tests/query_tool_tests.py", line 643, in _query_tool_notify_statements
'//div[contains(@class, "sql-editor-message") and '
File "/tmp/build/5988fb0a/pgadmin-repo/web/regression/feature_utils/pgadmin_page.py", line 169, in find_by_xpath
lambda driver: driver.find_element_by_xpath(xpath)
File "/tmp/build/5988fb0a/pgadmin-repo/web/regression/feature_utils/pgadmin_page.py", line 261, in wait_for_element
return self._wait_for("element to exist", element_if_it_exists)
File "/tmp/build/5988fb0a/pgadmin-repo/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for
"Timed out waiting for " + waiting_for_message
File "/root/.pyenv/versions/pgadmin/lib/python2.7/site-packages/selenium/webdriver/support/wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
TimeoutException: Message: Timed out waiting for element to exist

All the failures are related to query_tool_notify_statements.  Please take another look.

Sincerely,

Victoria & Joao

On Tue, May 15, 2018 at 6:01 AM Akshay Joshi <[hidden email]> wrote:
Hi Hackers,

Attached is the patch to capture the notification from psycopg2 and displayed it in "Messages" tab of query tool. Added feature test to cover this scenario.

Refer Notification.png file to how it looks in "Messages" tab. Please review it.

--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Reply | Threaded
Open this post in threaded view
|

Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

Akshay Joshi
Hi Joao

On Tue, 15 May 2018, 19:36 Joao De Almeida Pereira, <[hidden email]> wrote:
Hi Akshay,

This patch is flaky; it doesn't always pass the tests in our pipeline.

======================================================================
ERROR: runTest (pgadmin.feature_tests.query_tool_tests.QueryToolFeatureTest)
Query tool feature test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/build/5988fb0a/pgadmin-repo/web/pgadmin/feature_tests/query_tool_tests.py", line 101, in runTest
self._query_tool_notify_statements()
File "/tmp/build/5988fb0a/pgadmin-repo/web/pgadmin/feature_tests/query_tool_tests.py", line 643, in _query_tool_notify_statements
'//div[contains(@class, "sql-editor-message") and '
File "/tmp/build/5988fb0a/pgadmin-repo/web/regression/feature_utils/pgadmin_page.py", line 169, in find_by_xpath
lambda driver: driver.find_element_by_xpath(xpath)
File "/tmp/build/5988fb0a/pgadmin-repo/web/regression/feature_utils/pgadmin_page.py", line 261, in wait_for_element
return self._wait_for("element to exist", element_if_it_exists)
File "/tmp/build/5988fb0a/pgadmin-repo/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for
"Timed out waiting for " + waiting_for_message
File "/root/.pyenv/versions/pgadmin/lib/python2.7/site-packages/selenium/webdriver/support/wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
TimeoutException: Message: Timed out waiting for element to exist

All the failures are related to query_tool_notify_statements.  Please take another look.

     There is some serious problems of timeout issues. I have tested it couple of times and working fine. Will test tomorrow one more time. I have followed the code written in the same file. If those test cases have passed then this should also. 

Sincerely,

Victoria & Joao

On Tue, May 15, 2018 at 6:01 AM Akshay Joshi <[hidden email]> wrote:
Hi Hackers,

Attached is the patch to capture the notification from psycopg2 and displayed it in "Messages" tab of query tool. Added feature test to cover this scenario.

Refer Notification.png file to how it looks in "Messages" tab. Please review it.

--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Reply | Threaded
Open this post in threaded view
|

Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

Akshay Joshi
Hi Hackers,

On Tue, May 15, 2018 at 9:52 PM, Akshay Joshi <[hidden email]> wrote:
Hi Joao

On Tue, 15 May 2018, 19:36 Joao De Almeida Pereira, <[hidden email]> wrote:
Hi Akshay,

This patch is flaky; it doesn't always pass the tests in our pipeline.

======================================================================
ERROR: runTest (pgadmin.feature_tests.query_tool_tests.QueryToolFeatureTest)
Query tool feature test
----------------------------------------------------------------------
Traceback (most recent call last):
File "/tmp/build/5988fb0a/pgadmin-repo/web/pgadmin/feature_tests/query_tool_tests.py", line 101, in runTest
self._query_tool_notify_statements()
File "/tmp/build/5988fb0a/pgadmin-repo/web/pgadmin/feature_tests/query_tool_tests.py", line 643, in _query_tool_notify_statements
'//div[contains(@class, "sql-editor-message") and '
File "/tmp/build/5988fb0a/pgadmin-repo/web/regression/feature_utils/pgadmin_page.py", line 169, in find_by_xpath
lambda driver: driver.find_element_by_xpath(xpath)
File "/tmp/build/5988fb0a/pgadmin-repo/web/regression/feature_utils/pgadmin_page.py", line 261, in wait_for_element
return self._wait_for("element to exist", element_if_it_exists)
File "/tmp/build/5988fb0a/pgadmin-repo/web/regression/feature_utils/pgadmin_page.py", line 327, in _wait_for
"Timed out waiting for " + waiting_for_message
File "/root/.pyenv/versions/pgadmin/lib/python2.7/site-packages/selenium/webdriver/support/wait.py", line 80, in until
raise TimeoutException(message, screen, stacktrace)
TimeoutException: Message: Timed out waiting for element to exist

All the failures are related to query_tool_notify_statements.  Please take another look.

     There is some serious problems of timeout issues. I have tested it couple of times and working fine. Will test tomorrow one more time. I have followed the code written in the same file. If those test cases have passed then this should also. 

      Issue is with Python 2.7, yesterday i have verified it on Python 3.5. Attached is the modified patch, please review it. 

Sincerely,

Victoria & Joao

On Tue, May 15, 2018 at 6:01 AM Akshay Joshi <[hidden email]> wrote:
Hi Hackers,

Attached is the patch to capture the notification from psycopg2 and displayed it in "Messages" tab of query tool. Added feature test to cover this scenario.

Refer Notification.png file to how it looks in "Messages" tab. Please review it.

--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246



--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246

RM_3204_v2.patch (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

Anthony Emengo
Hey,

The code looks great! The tests all passed as well.

Sincerely

Anthony and Victoria
Reply | Threaded
Open this post in threaded view
|

Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

Dave Page-7
Hi

On Wed, May 16, 2018 at 2:51 PM, Anthony Emengo <[hidden email]> wrote:
Hey,

The code looks great! The tests all passed as well.

Agreed - however, unless you check the Messages panel, you're not likely to see that a message was received.

Can we also show each message in an alertify panel?
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
Reply | Threaded
Open this post in threaded view
|

Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

Akshay Joshi
Hi Dave

On Fri, May 18, 2018 at 3:58 PM, Dave Page <[hidden email]> wrote:
Hi

On Wed, May 16, 2018 at 2:51 PM, Anthony Emengo <[hidden email]> wrote:
Hey,

The code looks great! The tests all passed as well.

Agreed - however, unless you check the Messages panel, you're not likely to see that a message was received.

Can we also show each message in an alertify panel?

    We need to change the design I guess, as we are currently send this as part of Messages. We will have to send this separately and show it in the alertify panel.
 
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

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



--
Akshay Joshi
Sr. Software Architect


Phone: +91 20-3058-9517
Mobile: +91 976-788-8246
Reply | Threaded
Open this post in threaded view
|

Re: [pgAdmin4][Patch] Feature #3204 Notify/Listen not working in version 2.1

Dave Page-7


On Fri, May 18, 2018 at 12:11 PM, Akshay Joshi <[hidden email]> wrote:
Hi Dave

On Fri, May 18, 2018 at 3:58 PM, Dave Page <[hidden email]> wrote:
Hi

On Wed, May 16, 2018 at 2:51 PM, Anthony Emengo <[hidden email]> wrote:
Hey,

The code looks great! The tests all passed as well.

Agreed - however, unless you check the Messages panel, you're not likely to see that a message was received.

Can we also show each message in an alertify panel?

    We need to change the design I guess, as we are currently send this as part of Messages. We will have to send this separately and show it in the alertify panel.

Yeah. Unfortunately I think notifications need to be more "active" than the messages. 

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

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