Bug 32671 - basic_workflow.t is failing on slow servers
Summary: basic_workflow.t is failing on slow servers
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 25551
  Show dependency treegraph
 
Reported: 2023-01-18 09:12 UTC by Jonathan Druart
Modified: 2024-04-26 20:28 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.04,23.05.10


Attachments
Bug 32671: Prevent selenium/basic_workflow.t to fail if run on slow servers (2.74 KB, patch)
2024-03-11 15:48 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2023-01-18 09:12:57 UTC
09:09:13 koha_1       | CP main = 3.20
09:09:13 koha_1       | CP add patron category = 5.66
09:09:13 koha_1       | CP add patron = 5.04
09:09:13 koha_1       | CP add biblio = 0.20
09:09:13 koha_1       | CP add items = 13.62
09:09:13 koha_1       | 
09:09:13 koha_1       | #   Failed test at t/db_dependent/selenium/basic_workflow.t line 240.
09:09:13 koha_1       | #          got: 'Checkouts (1)'
09:09:13 koha_1       | #     expected: 'Checkouts (2)'
09:09:13 koha_1       | CP checkout = 22.22
09:09:13 koha_1       | CP checkin = 8.07
09:09:13 koha_1       | CP holds = 10.32
09:09:13 selenium_1   | 1674029262102	Marionette	INFO	Stopped listening on port 41815
09:09:13 selenium_1   | JavaScript error: resource:///modules/Interactions.jsm, line 230: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIUserIdleService.removeIdleObserver]
09:09:13 selenium_1   | 08:07:43.008 INFO [ActiveSessions$1.onStop] - Removing session 5bd9205a-1b9c-4ec1-9621-3a0a16c4ab24 (org.openqa.selenium.firefox.GeckoDriverService)
09:09:13 koha_1       | # Looks like you failed 1 test of 22.
09:09:13 koha_1       | [08:07:43] t/db_dependent/selenium/basic_workflow.t 

Koha_22.05_D11/138
Comment 1 Jonathan Druart 2023-05-16 14:07:39 UTC
Koha_Master/2516

koha_1       | CP main = 3.14
koha_1       | CP add patron category = 5.06
koha_1       | 
koha_1       | #   Failed test at t/db_dependent/selenium/basic_workflow.t line 122.
koha_1       | Wide character in print at /usr/share/perl/5.32/Test2/Formatter/TAP.pm line 125.
koha_1       | #                   'Add patron (test cat description) › Patrons › Koha'
koha_1       | #     doesn't match '(?^u:Patron details for test_patron_surname)'
koha_1       | CP add patron = 8.83
koha_1       | CP add biblio = 0.23
Comment 2 Jonathan Druart 2023-05-25 09:55:57 UTC
Koha_Master/2530

koha_1       | CP main = 3.30
koha_1       | 
koha_1       | #   Failed test at t/db_dependent/selenium/basic_workflow.t line 113.
koha_1       | Wide character in print at /usr/share/perl/5.32/Test2/Formatter/TAP.pm line 125.
koha_1       | #                   'Patron categories › Administration › Koha'
koha_1       | #     doesn't match '(?^u:New category)'
koha_1       | 
koha_1       | STRACE:	/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...} 
koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
koha_1       | 	(eval 1858):1 in Selenium::Remote::Driver::__ANON__
koha_1       | 	(eval 1860):2 in Selenium::Remote::Driver::__ANON__
koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in Selenium::Remote::Driver::_execute_command
koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in (eval)
koha_1       | 	/kohadevbox/koha/t/lib/Selenium.pm:117 in Selenium::Remote::Driver::find_element
koha_1       | 	t/db_dependent/selenium/basic_workflow.t:114 in t::lib::Selenium::fill_form
Comment 3 Jonathan Druart 2023-05-30 13:19:52 UTC
Koha_Master/2535

koha_1       | CP main = 3.84
koha_1       | 
koha_1       | #   Failed test at t/db_dependent/selenium/basic_workflow.t line 113.
koha_1       | Wide character in print at /usr/share/perl/5.32/Test2/Formatter/TAP.pm line 125.
koha_1       | #                   'Patron categories › Administration › Koha'
koha_1       | #     doesn't match '(?^u:New category)'
koha_1       | 
koha_1       | STRACE:	/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...} 
koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
koha_1       | 	(eval 1858):1 in Selenium::Remote::Driver::__ANON__
koha_1       | 	(eval 1860):2 in Selenium::Remote::Driver::__ANON__
koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in Selenium::Remote::Driver::_execute_command
koha_1       | 	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in (eval)
koha_1       | 	/kohadevbox/koha/t/lib/Selenium.pm:117 in Selenium::Remote::Driver::find_element
koha_1       | 	t/db_dependent/selenium/basic_workflow.t:114 in t::lib::Selenium::fill_form
Comment 4 Jonathan Druart 2023-05-31 07:49:06 UTC
Koha_Master/2537

koha_1       | CP main = 3.56
koha_1       | 
koha_1       | #   Failed test at t/db_dependent/selenium/basic_workflow.t line 113.
koha_1       | Wide character in print at /usr/share/perl/5.32/Test2/Formatter/TAP.pm line 125.
koha_1       | #                   'Patron categories › Administration › Koha'
koha_1       | #     doesn't match '(?^u:New category)'
koha_1       | CP add patron category = 11.80
koha_1       | CP add patron = 5.86
koha_1       | CP add biblio = 0.32
Comment 5 Jonathan Druart 2023-06-07 07:49:15 UTC
Koha_Master/2544

koha_1       | CP add items = 14.97
koha_1       | CP checkout = 8.63
koha_1       | CP checkin = 7.90
koha_1       | 
koha_1       | #   Failed test at t/db_dependent/selenium/basic_workflow.t line 279.
koha_1       | #          got: '1'
koha_1       | #     expected: '2'
koha_1       | CP holds = 15.34
Comment 6 Katrin Fischer 2024-03-09 12:22:29 UTC
We have another of these in run #2808:

koha_1       | #   Failed test at t/db_dependent/selenium/basic_workflow.t line 122.
koha_1       | Wide character in print at /usr/share/perl/5.32/Test2/Formatter/TAP.pm line 125.
koha_1       | #                   'Add patron (test cat description) › Patrons › Koha'
koha_1       | #     doesn't match '(?^u:Patron details for test_patron_surname)'

Help much appreciated!
Comment 7 Jonathan Druart 2024-03-11 15:48:57 UTC
Created attachment 163047 [details] [review]
Bug 32671: Prevent selenium/basic_workflow.t to fail if run on slow servers

When submitting the form to create a new patron we are doing a POST
memberentry.pl that is redirecting to moremember.pl

The selenium test is expecting for the end of the request to test the
page's title against "Patron details for ".

But it's only waiting for the POST response (302), not the GET
moremember that will display the patron's details.

You can simulate a slow server using cpulimit: `cpulimit -b -p $PID -l 1`
replacing $PID with the pid of the starman process.

Note that other tests are failing using 1%, but... baby steps.

The current failre:
 #   Failed test at t/db_dependent/selenium/basic_workflow.t line 122
 Wide character in print at /usr/share/perl/5.32/Test2/Formatter/TAP.pm line 125
 #                   'Add patron (test cat description) › Patrons › Koha'
 #     doesn't match '(?^u:Patron details for test_patron_surname)'

The next one (NOT fixed by this patch):

 #   Failed test at t/db_dependent/selenium/basic_workflow.t line 256.
 #                   '
 #
 #             Checkouts (0)#         #         '#     doesn't match '(?^u:Checkouts \(1\))'
 t/db_dependent/selenium/basic_workflow.t .. 14/22 #   Failed test at t/db_dependent/selenium/basic_workflow.t line 256.
 #                   '
 #
 #             Checkouts (1)
 #
 #         '
 #     doesn't match '(?^u:Checkouts \(2\))'
 t/db_dependent/selenium/basic_workflow.t .. 16/22 #   Failed test at t/db_dependent/selenium/basic_workflow.t line 256.
 #                   '
 #
 #             Checkouts (2)
 #
 #         '
 #     doesn't match '(?^u:Checkouts \(3\))'
Comment 8 Jonathan Druart 2024-03-11 15:49:41 UTC
We are loosing a test (the form submission redirect to the patron's details), but it's not worth spending more time here IMO.
Comment 9 Katrin Fischer 2024-03-15 07:08:36 UTC
Also taking this one for master. Sue me ;)
Comment 10 Katrin Fischer 2024-03-15 08:39:48 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 11 Fridolin Somers 2024-03-18 08:54:54 UTC
Pushed to 23.11.x for 23.11.04
Comment 12 Lucas Gass 2024-03-19 21:31:06 UTC
Backported to 23.05.x for upcoming 23.05.10.
Comment 13 Jonathan Druart 2024-03-21 08:45:50 UTC
Reappeared?

Koha_Master/2818


koha_1       | CP add items = 16.87
koha_1       | CP checkout = 12.84
koha_1       | CP checkin = 9.72
koha_1       | 
koha_1       | #   Failed test at t/db_dependent/selenium/basic_workflow.t line 281.
koha_1       | #          got: '1'
koha_1       | #     expected: '2'
koha_1       | CP holds = 14.88
selenium_1   | 1710957630124	Marionette	INFO	Stopped listening on port 35023
selenium_1   | JavaScript error: resource:///modules/Interactions.jsm, line 230: NS_ERROR_FAILURE: Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIUserIdleService.removeIdleObserver]
selenium_1   | 18:00:31.171 INFO [ActiveSessions$1.onStop] - Removing session baac1e07-489d-47e6-a32c-f7e8b2da51d5 (org.openqa.selenium.firefox.GeckoDriverService)
koha_1       | # Looks like you failed 1 test of 22.
koha_1       | [18:00:31] t/db_dependent/selenium/basic_workflow.t