Skip to content

Commit

Permalink
Travis: Limit worker count to 4
Browse files Browse the repository at this point in the history
By default it starts 30 workers on Travis because there are 32 logical cores available. This is ridiculously excessive and pollutes the log with debug spam.
  • Loading branch information
dktapps committed Jun 1, 2018
1 parent ec28612 commit 5d07f66
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ before_script:
- composer install

script:
- ./tests/travis.sh
- ./tests/travis.sh -t4

notifications:
email: false
8 changes: 6 additions & 2 deletions tests/travis.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
#!/bin/bash

PHP_BINARY="php"
PM_WORKERS="auto"

while getopts "p:" OPTION 2> /dev/null; do
while getopts "p:t:" OPTION 2> /dev/null; do
case ${OPTION} in
p)
PHP_BINARY="$OPTARG"
;;
t)
PM_WORKERS="$OPTARG"
;;
esac
done

Expand Down Expand Up @@ -39,7 +43,7 @@ mkdir "$DATA_DIR"
mkdir "$PLUGINS_DIR"
mv DevTools.phar "$PLUGINS_DIR"
cp -r tests/plugins/PocketMine-TesterPlugin "$PLUGINS_DIR"
echo -e "stop\n" | "$PHP_BINARY" PocketMine-MP.phar --no-wizard --disable-ansi --disable-readline --debug.level=2 --data="$DATA_DIR" --plugins="$PLUGINS_DIR" --anonymous-statistics.enabled=0
echo -e "stop\n" | "$PHP_BINARY" PocketMine-MP.phar --no-wizard --disable-ansi --disable-readline --debug.level=2 --data="$DATA_DIR" --plugins="$PLUGINS_DIR" --anonymous-statistics.enabled=0 --settings.async-workers="$PM_WORKERS"

output=$(grep '\[TesterPlugin\]' "$DATA_DIR/server.log")
if [ "$output" == "" ]; then
Expand Down

0 comments on commit 5d07f66

Please sign in to comment.