Skip to content

Commit

Permalink
fixed test 373 to work at linux and windows
Browse files Browse the repository at this point in the history
  • Loading branch information
tomatolog committed Mar 11, 2019
1 parent 6ecca0e commit ca80ac2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
6 changes: 5 additions & 1 deletion test/test_373/model.bin
@@ -1 +1,5 @@
a:1:{i:0;a:1:{i:0;a:5:{i:0;s:17:"index_type | disk";i:1;s:51:"ERROR: SHOW INDEX STATUS requires an existing index";i:2;s:16:"Indexes reloaded";i:3;s:51:"ERROR: SHOW INDEX STATUS requires an existing index";i:4;s:17:"index_type | disk";}}}
a:1:{i:0;a:1:{i:0;a:5:{i:0;s:33:"dummy | local
idx1 | local
2 rows";i:1;s:51:"ERROR: SHOW INDEX STATUS requires an existing index";i:2;s:16:"Indexes reloaded";i:3;s:33:"dummy | local
idx2 | local
2 rows";i:4;s:51:"ERROR: SHOW INDEX STATUS requires an existing index";}}}
17 changes: 13 additions & 4 deletions test/test_373/test.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<test>
<name>Indexes autoreload</name>
<name>indexes autoreload</name>

<requires>
<non-rt/>
Expand Down Expand Up @@ -33,6 +33,15 @@ index idx1
docinfo = extern
dict = keywords
}


index dummy
{
source = src1
path = <data_path/>/dummy
docinfo = extern
dict = keywords
}
</config>

<db_create>CREATE TABLE `test_table` ( `id` int(11) NOT NULL, `text` varchar(16384) CHARACTER SET utf8 NOT NULL )</db_create>
Expand All @@ -42,7 +51,7 @@ index idx1
$ql->Reconnect();
$results = array();
$results[] = explode( PHP_EOL, $ql->Query ( 'SHOW INDEX idx1 STATUS' ))[0];
$results[] = $ql->Query ( 'SHOW TABLES' );
$results[] = $ql->Query ( 'SHOW INDEX idx2 STATUS' );
$config = file(testdir('config.conf'));
Expand All @@ -55,12 +64,12 @@ foreach ( $config as $line ) {
}
file_put_contents(testdir('config.conf'), $updatedConfig);
RunIndexer ( $errors, '--rotate --all' );
RunIndexer ( $errors, '--rotate dummy' );
sleep(1);
$results[] = 'Indexes reloaded';
$results[] = $ql->Query ( 'SHOW TABLES' );
$results[] = $ql->Query ( 'SHOW INDEX idx1 STATUS' );
$results[] = explode( PHP_EOL, $ql->Query ( 'SHOW INDEX idx2 STATUS' ))[0];
]]></custom_test>

Expand Down

0 comments on commit ca80ac2

Please sign in to comment.