Bugzilla – Attachment 113796 Details for
Bug 26031
www/search_utf8.t is failing randomly and must be removed/replaced
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26031: add sleep(1) to fix www/search_utf8.t failing randomly
Bug-26031-add-sleep1-to-fix-wwwsearchutf8t-failing.patch (text/plain), 7.86 KB, created by
Mason James
on 2020-11-19 03:19:29 UTC
(
hide
)
Description:
Bug 26031: add sleep(1) to fix www/search_utf8.t failing randomly
Filename:
MIME Type:
Creator:
Mason James
Created:
2020-11-19 03:19:29 UTC
Size:
7.86 KB
patch
obsolete
>From fb23b880b6f885b65e7aca8992e25682db501042 Mon Sep 17 00:00:00 2001 >From: Mason James <mtj@kohaaloha.com> >Date: Thu, 19 Nov 2020 15:34:51 +1300 >Subject: [PATCH] Bug 26031: add sleep(1) to fix www/search_utf8.t failing > randomly >Content-Type: text/plain; charset="utf-8" > >to test... > 1/ apply patch > 2/ run test > 3/ observe PASS > >root@kohadevbox:/kohadevbox/koha# export KOHA_INTRANET_URL="http://kohadev-intra.myDNSname.org:8081" >root@kohadevbox:/kohadevbox/koha# export KOHA_OPAC_URL="http://kohadev.myDNSname.org:8080" >root@kohadevbox:/kohadevbox/koha# prove -v ./t/db_dependent/www/search_utf8.t >1..99 >ok 1 - connect to intranet >ok 2 - login to staff interface >ok 3 - load main page >ok 4 - open tools module >ok 5 - go to stage MARC >ok 6 - uploaded file >ok 7 - upload succeeded >ok 8 - reopen stage MARC page >ok 9 - stage MARC >ok 10 - have job ID >ok 11 - job was completed >ok 12 - reopen stage MARC page at end of upload >ok 13 - stage MARC >ok 14 - view batch >ok 15 - imported records into catalog >ok 16 - got search on intranet >ok 17 - test staff 'kw' search >ok 18 - got search on intranet2 >ok 19 - test staff 'kw' search 2 >ok 20 - Base is like "(?^u:search.pl\?advsearch=1&idx=kw&q=%CE%91%CE%B8%CE%AE%CE%BD%CE%B1)" >ok 21 - UTF-8 are multi-byte. Good >ok 22 - UTF-8 chars are correctly present. Good >ok 23 - got opac >ok 24 - test opac default search >ok 25 - got opac2 >ok 26 - test opac default search 2 >ok 27 - Base is like "(?^u:opac-search.pl\?(idx=&)?q=%CE%91%CE%B8%CE%AE%CE%BD%CE%B1)" >ok 28 - Base does not contain an idx >ok 29 - UTF-8 are multi-byte. Good >ok 30 - UTF-8 chars are correctly present. Good >ok 31 - view and clean batch >ok 32 - biblio on intranet >ok 33 - biblio deleted >ok 34 - connect to intranet >ok 35 - login to staff interface >ok 36 - load main page >ok 37 - open tools module >ok 38 - go to stage MARC >ok 39 - uploaded file >ok 40 - upload succeeded >ok 41 - reopen stage MARC page >ok 42 - stage MARC >ok 43 - have job ID >ok 44 - job was completed >ok 45 - reopen stage MARC page at end of upload >ok 46 - stage MARC >ok 47 - view batch >ok 48 - imported records into catalog >ok 49 - got search on intranet >ok 50 - test staff 'kw' search >ok 51 - got search on intranet2 >ok 52 - test staff 'kw' search 2 >ok 53 - Base is like "(?^u:search.pl\?advsearch=1&idx=kw&q=Ram%C3%B2n)" >ok 54 - UTF-8 are multi-byte. Good >ok 55 - UTF-8 chars are correctly present. Good >ok 56 - got opac >ok 57 - test opac default search >ok 58 - got opac2 >ok 59 - test opac default search 2 >ok 60 - Base is like "(?^u:opac-search.pl\?(idx=&)?q=Ram%C3%B2n)" >ok 61 - Base does not contain an idx >ok 62 - UTF-8 are multi-byte. Good >ok 63 - UTF-8 chars are correctly present. Good >ok 64 - view and clean batch >ok 65 - biblio on intranet >ok 66 - biblio deleted >ok 67 - connect to intranet >ok 68 - login to staff interface >ok 69 - load main page >ok 70 - open tools module >ok 71 - go to stage MARC >ok 72 - uploaded file >ok 73 - upload succeeded >ok 74 - reopen stage MARC page >ok 75 - stage MARC >ok 76 - have job ID >ok 77 - job was completed >ok 78 - reopen stage MARC page at end of upload >ok 79 - stage MARC >ok 80 - view batch >ok 81 - imported records into catalog >ok 82 - got search on intranet >ok 83 - test staff 'kw' search >ok 84 - got search on intranet2 >ok 85 - test staff 'kw' search 2 >ok 86 - Base is like "(?^u:search.pl\?advsearch=1&idx=kw&q=%F0%A0%BB%BAtomasito%F0%A0%BB%BA)" >ok 87 - UTF-8 are multi-byte. Good >ok 88 - UTF-8 chars are correctly present. Good >ok 89 - got opac >ok 90 - test opac default search >ok 91 - got opac2 >ok 92 - test opac default search 2 >ok 93 - Base is like "(?^u:opac-search.pl\?(idx=&)?q=%F0%A0%BB%BAtomasito%F0%A0%BB%BA)" >ok 94 - Base does not contain an idx >ok 95 - UTF-8 are multi-byte. Good >ok 96 - UTF-8 chars are correctly present. Good >ok 97 - view and clean batch >ok 98 - biblio on intranet >ok 99 - biblio deleted >ok >All tests successful. >Files=1, Tests=99, 153 wallclock secs ( 0.05 usr 0.01 sys + 2.92 cusr 1.06 csys = 4.04 CPU) >Result: PASS > >real 2m32.825s >user 0m3.048s >sys 0m1.096s >--- > t/db_dependent/www/search_utf8.t | 28 +++++++++++++++++----------- > 1 file changed, 17 insertions(+), 11 deletions(-) > >diff --git a/t/db_dependent/www/search_utf8.t b/t/db_dependent/www/search_utf8.t >index 499e618..c41601e 100755 >--- a/t/db_dependent/www/search_utf8.t >+++ b/t/db_dependent/www/search_utf8.t >@@ -234,7 +234,6 @@ sub test_search{ > > $agent->follow_link_ok( { text => 'Manage staged records' }, 'view batch' ); > >- > $agent->form_number(6); > $agent->field( 'framework', '' ); > $agent->click_ok( 'mainformsubmit', "imported records into catalog" ); >@@ -249,8 +248,9 @@ sub test_search{ > > # --------------------------------- TEST INTRANET SEARCH > >- > $agent->get_ok( "$intranet/cgi-bin/koha/catalogue/search.pl" , "got search on intranet"); >+ sleep 1; >+ > $agent->form_number(5); > $agent->field('idx', 'kw'); > $agent->field('q', $search_key); >@@ -262,48 +262,55 @@ sub test_search{ > my $xslt_filepath = C4::XSLT::_get_best_default_xslt_filename( C4::Context->config('intrahtdocs'), C4::Context->preference("template"), 'en', $xslt_file ); > return sprintf( "===DIAG===\n%s is %s\n%s %s\n==========", $pref, C4::Context->preference($pref), $xslt_filepath, ( -f $xslt_filepath ? 'exists' : 'does not exist' )); > }; >+ sleep 1; >+ like( $intra_text, qr|Publication details: $publisher|, "test staff 'kw' search" ) or diag($diag->()); > >- like( $intra_text, qr|Publication details: $publisher|, ) or diag($diag->()); >- >- $agent->get_ok( "$intranet/cgi-bin/koha/catalogue/search.pl" , "got search on intranet"); >+ $agent->get_ok( "$intranet/cgi-bin/koha/catalogue/search.pl" , "got search on intranet2"); > $agent->form_number(5); > $agent->field('idx', 'kw'); > $agent->field('q', $publisher); > $agent->click(); > $intra_text = $agent->text(); > >- like( $intra_text, qr|Publication details: $publisher|, ); >+ sleep 1; >+ like( $intra_text, qr|Publication details: $publisher|, "test staff 'kw' search 2" ); > my $expected_base = q|search.pl\?advsearch=1&idx=kw&q=| . uri_escape_utf8( $publisher ); > $agent->base_like(qr|$expected_base|, ); > >+ sleep 1; > ok ( ( length(Encode::encode('UTF-8', $intra_text)) != length($intra_text) ) , 'UTF-8 are multi-byte. Good') ; >+ sleep 1; > ok ($intra_text =~ $utf8_reg, 'UTF-8 chars are correctly present. Good'); > # -------------------------------------------------- TEST ON OPAC > >+ sleep 1; > $agent->get_ok( "$opac" , "got opac"); > $agent->form_name('searchform'); > $agent->field( 'q', $search_key ); > $agent->field( 'idx', '' ); > $agent->click( ); > my $opac_text = $agent->text() ; >- like( $opac_text, qr|Publication details: $publisher|, ); >+ like( $opac_text, qr|Publication details: $publisher|, 'test opac default search' ); > >- $agent->get_ok( "$opac" , "got opac"); >+ sleep 1; >+ $agent->get_ok( "$opac" , "got opac2"); > $agent->form_name('searchform'); > $agent->field('q', $publisher); > $agent->field( 'idx', '' ); > $agent->click(); > $opac_text = $agent->text(); > >- like( $opac_text, qr|Publication details: $publisher|, ); >+ sleep 1; >+ like( $opac_text, qr|Publication details: $publisher|, 'test opac default search 2' ); > $expected_base = q|opac-search.pl\?(idx=&)?q=| . uri_escape_utf8( $publisher ); > $agent->base_like(qr|$expected_base|, ); > # Test added on BZ 14909 in addition to making the empty idx= optional > # in the previous regex > $agent->base_unlike( qr|idx=\w+|, 'Base does not contain an idx' ); > >- >+ sleep 1; > ok ( ( length(Encode::encode('UTF-8', $opac_text)) != length($opac_text) ) , 'UTF-8 are multi-byte. Good') ; >+ sleep 1; > ok ($opac_text =~ $utf8_reg, 'UTF-8 chars are correctly present. Good'); > > #-------------------------------------------------- REVERT >@@ -318,7 +325,6 @@ sub test_search{ > cleanup(); > } > >- > # function that launches the zebra daemon > sub launch_zebra { > >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26031
:
108780
|
108798
|
113793
|
113796
|
113811
|
113812