Skip to content

Commit

Permalink
Fix/timeouts (#74)
Browse files Browse the repository at this point in the history
* Improve timeouts
---------

Co-authored-by: djklim87 <klim@manticoresearch.com>
  • Loading branch information
djklim87 and djklim87 authored Feb 12, 2024
1 parent bc48deb commit 1c88f96
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 20 deletions.
2 changes: 1 addition & 1 deletion clt_tests/tests/base/init.recb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(dockerd > /var/log/dockerd.log 2>&1 &) > /dev/null
––– output –––
––– input –––
timeout 60 tail -n 100 -f /var/log/dockerd.log | grep -qm1 'API listen on /var/run/docker.sock' && echo 'Done' || echo 'Timeout failed'
if timeout 60 grep -qm1 'API listen on /var/run/docker.sock' <(tail -n 0 -f /var/log/dockerd.log); then echo 'Done'; else echo 'Timeout failed'; fi
––– output –––
Done
––– input –––
Expand Down
2 changes: 1 addition & 1 deletion clt_tests/tests/config-flexible-with-custom-conf.rec
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ docker run --name manticore -v "/tmp/manticore.conf:/etc/manticoresearch/mantico
––– output –––
#!/[0-9a-z]+/!#
––– input –––
sleep 5;docker logs manticore | grep "accepting connections"
if timeout 5 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Manticore failed to start properly in 10 seconds'; fi
––– output –––
accepting connections
––– input –––
Expand Down
2 changes: 1 addition & 1 deletion clt_tests/tests/config-flexible-with-default-conf.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker run -d -e searchd_max_packet_size=64m -e "common_lemmatizer_base=/usr/sha
––– output –––
#!/[0-9a-z]+/!#
––– input –––
sleep 5;docker logs manticore | grep "accepting connections"
if timeout 5 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Manticore failed to start properly in 10 seconds'; fi
––– output –––
accepting connections
––– input –––
Expand Down
2 changes: 1 addition & 1 deletion clt_tests/tests/plain-indexes-all.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker run -d -e CREATE_PLAIN_TABLES=1 --name manticore -v $(pwd)/clt_tests/test
––– output –––
#!/[0-9a-z]+/!#
––– input –––
sleep 5;docker logs manticore | grep "accepting connections"
if timeout 5 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Manticore failed to start properly in 10 seconds'; fi
––– output –––
accepting connections
––– input –––
Expand Down
5 changes: 3 additions & 2 deletions clt_tests/tests/plain-indexes-crontab.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker run -d -e "CREATE_PLAIN_TABLES=idx1;idx2:* * * * *" --name manticore -v $
––– output –––
#!/[0-9a-z]+/!#
––– input –––
timeout 5 docker logs -f manticore | grep -qm1 "accepting connections" && echo 'accepting connections' || echo 'Timeout failed'
if timeout 5 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Timeout failed'; fi
––– output –––
accepting connections
––– input –––
Expand Down Expand Up @@ -34,8 +34,9 @@ idx1.spm
idx1.spp
idx1.spt
––– input –––
sleep 65
if timeout 65 grep -qm1 'Indexer_idx2: rotating tables: successfully sent SIGHUP to searchd' <(docker logs -f manticore); then echo 'Cron job done'; else echo 'Cron job not run in 65 seconds'; fi
––– output –––
Cron job done
––– input –––
docker exec manticore ls | grep idx
––– output –––
Expand Down
5 changes: 3 additions & 2 deletions clt_tests/tests/plain-indexes-crontab2.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker run -d -e "CREATE_PLAIN_TABLES=idx1:* * * * *;idx2" --name manticore -v $
––– output –––
#!/[0-9a-z]+/!#
––– input –––
timeout 5 docker logs -f manticore | grep -qm1 "accepting connections" && echo 'accepting connections' || echo 'Timeout failed'
if timeout 5 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Timeout failed'; fi
––– output –––
accepting connections
––– input –––
Expand Down Expand Up @@ -34,8 +34,9 @@ idx2.spm
idx2.spp
idx2.spt
––– input –––
sleep 65
if timeout 65 grep -qm1 'Indexer_idx1: rotating tables: successfully sent SIGHUP to searchd' <(docker logs -f manticore); then echo 'Cron job done'; else echo 'Cron job not run in 65 seconds'; fi
––– output –––
Cron job done
––– input –––
docker exec manticore ls | grep idx | sort
––– output –––
Expand Down
2 changes: 1 addition & 1 deletion clt_tests/tests/plain-indexes-desired.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker run -d -e "CREATE_PLAIN_TABLES=idx1;idx2" --name manticore -v $(pwd)/clt_
––– output –––
#!/[0-9a-z]+/!#
––– input –––
sleep 5;docker logs manticore | grep "accepting connections"
if timeout 5 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Manticore failed to start properly in 10 seconds'; fi
––– output –––
accepting connections
––– input –––
Expand Down
5 changes: 3 additions & 2 deletions clt_tests/tests/plain-indexes-only-crontab.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@ docker run -d -e "CREATE_PLAIN_TABLES=idx1:* * * * *" --name manticore -v $(pwd)
––– output –––
#!/[0-9a-z]+/!#
––– input –––
timeout 5 docker logs -f manticore | grep -qm1 "accepting connections" && echo 'accepting connections' || echo 'Timeout failed'
if timeout 5 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Timeout failed'; fi
––– output –––
accepting connections
––– input –––
docker exec manticore ls | grep idx | sort
––– output –––
––– input –––
sleep 65
if timeout 65 grep -qm1 'Indexer_idx1: rotating tables: successfully sent SIGHUP to searchd' <(docker logs -f manticore); then echo 'Cron job done'; else echo 'Cron job not run in 65 seconds'; fi
––– output –––
Cron job done
––– input –––
docker exec manticore ls | grep idx | sort
––– output –––
Expand Down
2 changes: 1 addition & 1 deletion clt_tests/tests/query_log_to_stdout.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker run -d -e QUERY_LOG_TO_STDOUT=true --name manticore manticoresoftware/man
––– output –––
#!/[0-9a-z]+/!#
––– input –––
timeout 60 docker logs -f manticore | grep -qm1 "accepting connections" && echo 'accepting connections' || echo 'Timeout failed'
if timeout 60 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Timeout failed'; fi
––– output –––
accepting connections
––– input –––
Expand Down
2 changes: 1 addition & 1 deletion clt_tests/tests/simple-with-network-host.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker run --rm --name=manticore --network=host --quiet -d manticoresoftware/man
––– output –––
#!/[0-9a-z]+/!#
––– input –––
sleep 5;docker logs manticore | grep "accepting connections"
if timeout 5 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Manticore failed to start properly in 10 seconds'; fi
––– output –––
accepting connections
––– input –––
Expand Down
2 changes: 1 addition & 1 deletion clt_tests/tests/simple.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ docker run --rm --name=manticore --quiet -d manticoresoftware/manticore:current
––– output –––
#!/[0-9a-z]+/!#
––– input –––
sleep 5;docker logs manticore | grep "accepting connections"
if timeout 5 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Timeout failed'; fi
––– output –––
accepting connections
––– input –––
Expand Down
6 changes: 3 additions & 3 deletions clt_tests/tests/test-extra.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ docker run --rm -e EXTRA=0 --name manticore -d manticoresoftware/manticore:curre
––– output –––
#!/[0-9a-z]{40}$/!#
––– input –––
timeout 10 docker logs -f manticore 2>1 | grep -qm1 "accepting connections" && echo 'accepting connections' || echo 'Docker failed to start properly in 10 seconds'
if timeout 10 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Docker failed to start properly in 10 seconds'; fi
––– output –––
accepting connections
––– input –––
docker exec manticore searchd --version
––– output –––
Manticore %{SEMVER} #!/[a-z0-9]{7,9}@[0-9]{6}/!# dev
Manticore %{SEMVER} #!/[a-z0-9]{7,9}@[0-9]{8}/!# dev
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-%{YEAR}, Manticore Software LTD (https://manticoresearch.com)
Expand All @@ -23,7 +23,7 @@ sleep 1;docker run --rm -e EXTRA=1 --name manticore -v /tmp/idx:/var/lib/mantico
––– output –––
#!/[0-9a-z]{40}$/!#
––– input –––
timeout 60 docker logs -f manticore 2>&1 | grep -qEm1 "columnar.*?secondary.*?knn" && echo 'Done' || echo 'Not found'
if timeout 60 grep -qEm1 "columnar.*?secondary.*?knn" <(docker logs -f manticore 2>&1); then echo 'Done'; else echo 'Not found'; fi
––– output –––
Done
––– input –––
Expand Down
6 changes: 3 additions & 3 deletions clt_tests/tests/test-galera.rec
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ docker run --rm -e EXTRA=0 --name manticore -d manticoresoftware/manticore:curre
––– output –––
#!/[0-9a-z]{40}$/!#
––– input –––
timeout 10 docker logs -f manticore 2>1 | grep -qm1 "accepting connections" && echo 'accepting connections' || echo 'Docker failed to start properly in 10 seconds'
if timeout 10 grep -qm1 'accepting connections' <(docker logs -f manticore); then echo 'accepting connections'; else echo 'Docker failed to start properly in 10 seconds'; fi
––– output –––
accepting connections
––– input –––
docker exec manticore mysql -e "create cluster abc"
––– output –––
ERROR 1064 (42000) at line 1: failed to make cluster: replication init failed: 10 'feature not implemented'
ERROR 1064 (42000) at line 1: failed to make cluster: Wrong galera interface version. Got -1
––– input –––
docker stop manticore
––– output –––
Expand All @@ -20,7 +20,7 @@ sleep 1;docker run --rm -e EXTRA=1 --name manticore -v /tmp/idx:/var/lib/mantico
––– output –––
#!/[0-9a-z]{40}$/!#
––– input –––
timeout 60 docker logs -f manticore 2>&1 | grep -qEm1 "columnar.*?secondary.*?knn" && echo 'Done' || echo 'Not found'
if timeout 60 grep -qEm1 "columnar.*?secondary.*?knn" <(docker logs -f manticore 2>1); then echo 'Done'; else echo 'Not found'; fi
––– output –––
Done
––– input –––
Expand Down

0 comments on commit 1c88f96

Please sign in to comment.