Commit graph

276 commits

Author SHA1 Message Date
Eric House
1648c9b3e3 tweak to start GTK games and run a long time
I'm trying to fix game-start-time right now....
2017-11-04 09:27:33 -07:00
Eric House
55f5b500e3 cleanup: method names and logging 2017-11-02 06:19:35 -07:00
Eric House
a1433e5f3d add kill to relay.py; call from test script using curl
It'll eventually get called from Android and maybe linux, but for now
it's cool to have games disappear from the showinplay display when
they're done.
2017-10-31 20:05:07 -07:00
Eric House
8aeba861cf fix script to move db files again 2017-10-31 06:38:32 -07:00
Eric House
1373d0b1db make min-run configurable
With the new http stuff, at least for now, it takes longer to get things
communicated and so killing games after 2 seconds of runtime meant no
moves ever got made. Making it configurable, and passing 10 (seconds)
means nearly all games in a large test run complete reasonably quickly.
2017-10-29 09:26:07 -07:00
Eric House
3215affd68 tweaks to test script 2017-10-28 15:31:17 -07:00
Eric House
a8f06b53e2 test script; log threadid 2017-10-27 05:57:40 -07:00
Eric House
051b6a7220 change resign-ratio to resign-pct
To match the way other pct stuff works, in part because it seemed it
didn't.
2017-10-25 20:00:55 -07:00
Eric House
81df91c4db add commandline option to spec log dir location 2017-10-25 06:34:55 -07:00
Eric House
4c15723f90 add http option to test script 2017-10-22 11:43:56 -07:00
Eric House
5223ccabe1 add option to run forever 2017-10-19 20:50:33 -07:00
Eric House
4ed843a529 start UDP at 100% by default since all clients will be that way now 2015-12-29 19:01:15 -08:00
Eric House
e3d6cb74fc for some reason log files are now considered binary by grep, so -a option's needed 2015-12-29 18:59:52 -08:00
Eric House
49dc8e7d10 print index of game being killed so easier to find it in the list of
tiles-per-game
2015-05-17 11:53:48 -07:00
Eric House
3b7afa4557 pass --server if not setting forceChannel 2014-12-28 21:39:11 -08:00
Eric House
897c4d5786 add param to force a client to connect to host requesting a particular
channel. Works well enough that relay test script works. Not yet
integrated for let alone tested on Android.
2014-12-21 17:40:00 -08:00
Eric House
d81f022c78 Merge branch 'android_branch' into android_multi2
Conflicts:
	xwords4/linux/scripts/discon_ok2.sh
2014-12-15 16:48:10 -08:00
Eric House
eb5ae9edd3 declare as little-a array so key will be listed in numeric order 2014-12-15 16:41:15 -08:00
Eric House
45ef4fcb65 add --dup-packets calling through to linux client 2014-12-15 16:14:59 -08:00
Eric House
4835afbe4a simplify and print in order 2014-12-15 15:29:37 -08:00
Eric House
7560156351 summarize the number of tiles left every 20 passes to give better view
into games' progress
2014-12-15 15:11:29 -08:00
Eric House
1eb7d01be5 add option to turn on duplicate packets -- which fires an assert on
the relay instantly.
2014-12-11 20:23:51 -08:00
Eric House
97092e361c update grepped string to match changes in logging 2014-12-08 06:23:18 -08:00
Eric House
f84f9aa85f include timestamp of switch to UDP -- in case it needs to be
correlated with logs
2014-12-08 06:20:47 -08:00
Eric House
ba6151c385 remove param that causes assert to fire 2014-11-10 07:31:51 -08:00
Eric House
70f4541bbe Merge branch 'android_branch' into android_multi2
Conflicts:
	xwords4/common/comms.c
2014-11-06 20:09:20 -08:00
Eric House
a34a859d18 log channelNo more consistently 2014-11-06 18:44:19 -08:00
Eric House
9886d5a6e6 merge over changes to run with new bash 2014-10-22 18:57:33 -07:00
Eric House
737af802b0 don't abort if core file count goes down -- I probably removed some
old thing
2014-10-15 06:38:43 -07:00
Eric House
b82383a5ad fix -- I hope -- array syntax that was getting lots of games launched
without an app (until it got upgraded)
2014-10-01 19:49:46 -07:00
Eric House
92292ad1fe fix problems with undeclared variables that older bash didn't mind 2014-09-25 21:45:44 -07:00
Eric House
113c7a13d2 print number of devices left 2014-09-23 21:26:46 -07:00
Eric House
fe8bb0932c delete messages whose games have been deleted 2013-10-09 20:41:14 -07:00
Eric House
9169659c80 cleanup: let conversion to including devid and change in devid happen at different rates 2013-09-18 08:05:19 -07:00
Eric House
2629c07256 Address problem with devids (e.g. GCM): until now when you got a new
devid you tossed your relayID and reregistered.  Which meant any
existing messages meant for your relayID were orphaned, and any open
games didn't know who they belonged to until you reconnected to them
with your new relayID.  So: modify the UDP protocol (though not on
Android yet) to include both relayID and devid with registration, with
one or the other an empty string if not present or not changed from
earlier.  I can't fix existing clients that are dropping their
relayIDs, but when one does a re-connect without a relayID I can look
it up from the existing game record, then reuse it rather than issue a
new one.  Better than nothing -- and that protocol will be obsolete
soon anyway.
2013-09-14 21:06:14 -07:00
Eric House
b3342c6e8a for --clean-start option, try not to remove games not created by this script. 2013-08-28 07:29:23 -07:00
Eric House
42bbc946ae quote variable and echo when switching to udp 2013-08-15 07:20:22 -07:00
Eric House
ae21b6f0d8 use new --use-udp flag and, by default, switch devices from tcp- to
udp-based connections over time at a configurable rate.
2013-08-07 21:12:08 -07:00
Eric House
3a14b12cc5 exit when number of core files changes, not if it's non-zero 2013-07-20 12:52:32 -07:00
Eric House
27e90c2d2c exit as soon as there's a core file 2013-07-15 07:16:35 -07:00
Eric House
8a4e766b32 make 50% of games communicate via UDP by default 2013-07-11 20:39:40 -07:00
Eric House
48fbf15a69 needed to quote variable 2013-07-09 18:07:03 -07:00
Eric House
f5696334a9 changes to get the merged code to compile but not included by git in the commit 2013-07-09 07:25:23 -07:00
Eric House
d50c808f96 Merge branch 'android_branch' into gtk_multigame
Conflicts:
	xwords4/android/XWords4/src/org/eehouse/android/xw4/DlgDelegate.java
	xwords4/common/comms.c
	xwords4/linux/cursesmain.c
	xwords4/linux/cursesmain.h
	xwords4/linux/gtkmain.c
	xwords4/linux/gtkmain.h
	xwords4/linux/linuxmain.c
	xwords4/linux/main.h
	xwords4/linux/scripts/discon_ok2.sh
	xwords4/relay/xwrelay.cpp

(Note: The curses app crashes on exit with mempool assertions, but that's a problem before the merge.)
2013-07-09 07:18:00 -07:00
Eric House
9ceb1615b3 replace tabs with spaces 2013-06-30 17:24:33 -07:00
Eric House
b506a91068 add commandline params 2013-06-30 08:33:58 -07:00
Eric House
5c284fe6b0 test PID is live before killing it 2013-06-28 18:55:19 -07:00
Eric House
5842654418 fix pattern 2013-06-24 07:30:38 -07:00
Eric House
aca3a96b54 fix pattern so ended games are detected 2013-06-24 07:18:53 -07:00
Eric House
5e22508ff7 kill existing xwords instances as part of --clean-start 2013-06-21 06:58:20 -07:00
Eric House
6446819466 use nice to give the relay a fighting chance 2013-06-21 05:41:23 -07:00
Eric House
5bec10048b add --clean-start option to speed testing 2013-06-20 06:45:51 -07:00
Eric House
0fad19e38a make it possible to mix udp and non-udp games (which currently crashes the relay very rarely) 2013-01-24 18:56:10 -08:00
Eric House
cbb82eb5e8 add --via-udp option -- which causes app to crash because the memory
leak detector is working
2013-01-24 08:00:53 -08:00
Eric House
6ca966f22a make test script and linux client mimic case where relay regid is
rejected by relay.  Client re-registers and a new relay regid is
issued.
2012-11-12 07:27:20 -08:00
Eric House
b53412d98d Fix to actually work. Grrr. 2012-11-10 14:52:10 -08:00
Eric House
b0f85e02df use grep of app's help message to determine whether a param is
supported so can test with older clients and not crash.
2012-11-09 06:55:38 -08:00
Eric House
59937b8514 modify how devids are handled on the relay and the protocol through
which they're communicated to the device.  Device is expected to have
a platform-specific notion of ID which the relay stores in a new
devices table and indexes with a 32-bit number which is returned to
the device -- which is encouraged but not required to use it in lieu
of the longer ID in future communications.  Modify linux client and
test script to use the relay-supplied id.  Some of this is commented
out for now.
2012-11-03 10:58:01 -07:00
Eric House
4ea8569abc honor --min-devs flag 2012-10-27 08:15:07 -07:00
Eric House
a6bed2706d include, commented out, the parameter that makes things fall apart. I
think the protocol needs work to survive devices failing to save
state.  Better to work on making sure they always save.
2012-09-11 20:45:03 -07:00
Eric House
ad4231289f fix --max-devs and resigns begin allowed when only one game 2012-09-11 07:24:51 -07:00
Eric House
b343034cc2 add ability to pass params only to new version of app so that test of
upgrade from old to new needn't skip test of new features.
2012-05-28 11:04:39 -07:00
Eric House
e36635944e fix to make two-device games much more common than four-device ones 2012-05-27 19:05:27 -07:00
Eric House
5309da9845 add --undo-pct option that passes through to curses client 2012-05-24 22:17:10 -07:00
Eric House
f7c49a6620 remove shift: --one-per doesn't take a param 2012-05-08 06:15:06 -07:00
Eric House
c2d8b17747 add --sort-tiles and fix confict between param name in code and in usage() 2012-05-05 10:55:35 -07:00
Eric House
7afa4f26db use the new --trade-pct flag 2012-05-03 19:00:56 -07:00
Eric House
af26ebfff9 fix usage hint 2012-01-26 05:40:22 -08:00
Eric House
af7398ce20 fix undeclared variable. 2011-12-15 18:36:47 -08:00
Eric House
964d2dfb0b allow, by default, more than one-player-per-device, but require that
roomnames be unique to eliminate risk of devices not matching up
correctly.
2011-12-02 18:55:20 -08:00
Andy2
08063d9444 Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/android/XWords4/src/org/eehouse/android/xw4/NetUtils.java
	xwords4/android/XWords4/src/org/eehouse/android/xw4/XWApp.java
2011-12-01 21:18:37 -08:00
Eric House
6691c0713c Merge remote branch 'origin/android_branch' into android_branch 2011-12-01 20:16:15 -08:00
Eric House
0065f5078e add variable controlling odds of "upgrading" -- which still needs tweaking. 2011-12-01 20:16:09 -08:00
Eric House
1e48a8d615 Merge remote branch 'origin/android_branch' into android_branch
Conflicts:
	xwords4/common/model.c
2011-12-01 20:12:27 -08:00
Eric House
32f1dfa5da configure by passing params rather than setting ENV variables 2011-11-30 21:01:11 -08:00
Eric House
c39487e0cc add ability to start out with mix of old and new versions and have old
upgrade to new at random times.
2011-11-29 20:51:19 -08:00
Eric House
c1e420f726 Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/relay/rq.c
2011-11-29 06:45:32 -08:00
Eric House
c8b868c243 Separate app from params. No change in behavior (though restart of
existing games is now broken), but this sets up testing mid-game
upgrade.
2011-11-29 06:43:16 -08:00
Eric House
c6e994abef use $RANDOM rather than $SEED -- still repeatable, but avoids relay
problems when devices have same game seed.
2011-11-28 18:53:40 -08:00
Eric House
384a41ed5b add ability to specify seed and vary board-size 2011-11-25 18:03:51 -08:00
Eric House
b00327aa8b fix to work for NDEVS > 2. 2011-11-21 17:35:08 -08:00
Eric House
a0a8a816a4 make number of devices configurable 2011-11-21 10:09:29 -08:00
Eric House
55d23c9502 various improvements, including allowing to specify seed to enhance
reproducibility, copying xwrelay.log into directory with game logs
when they don't finish for easier analysis.
2011-11-17 19:58:08 -08:00
Andy2
2492e7cfc5 Merge branch 'android_branch' into send_in_background
Conflicts:
	xwords4/linux/cursesmain.c
2011-11-13 17:10:46 -08:00
Eric House
5be5e9fdeb cleanup script output 2011-11-10 18:39:35 -08:00
Andy2
00f743409a script for reproducing problem with relay games that show up randomly. 2011-11-10 06:51:30 -08:00
Andy2
956fe350ba remove changed param -- mmap's the default now. 2011-11-07 18:19:12 -08:00
Andy2
febf32040e don't kill xwords; it'll exit when it's done 2011-10-07 18:51:27 -07:00
Andy2
38adeb9160 improve script to be more patient but exit after there stop being
messages -- which usually means the games finished.  With this and
previous changes the background stuff works most of the time.  Now to
debug why it's not all of the time.
2011-09-30 18:22:25 -07:00
Andy2
9bc36cd431 not an error when wait fails 2011-09-30 06:51:48 -07:00
Andy2
9c586efb02 new script for testing this branch's changes: replying to
messages delivered in the background.
2011-09-30 05:43:24 -07:00
Andy2
4a49db5c2a initialize variable 2011-09-30 05:42:44 -07:00
Eric House
c2c673e932 improve testing of proxy delete by saving up a number of relayIDs and
sending with multiple -d flags to rq.
2011-08-16 19:44:37 -07:00
Eric House
47da43a581 use new param to turn on mmap 2011-07-18 18:08:31 -07:00
Andy2
c482df300b better value for RESIGN_RATIO 2011-07-15 18:24:26 -07:00
Andy2
1686f3d9a8 make --skip-confirm do what it says, and include it in test script. 2011-07-12 07:13:58 -07:00
Eric House
abf60e027d fix pattern to pick the right hostid. 2011-07-06 20:02:51 -07:00
Andy2
4789bac85e add new mode that only launches games after the relay says there's a
message for them.  This is to mimic a common way games are played on
Android and to ensure that there are no points where that style of
play hangs because no device in the game will be "up".
2011-07-04 19:46:12 -07:00
Eric House
e207e0e142 add option to run only one game at a time in a given room. The idea
was to mimic conditions that are creating a bug on-device but it
didn't work.  Still, a useful test case....
2011-07-02 23:12:16 -07:00
Eric House
5c5708fa66 try to fix race condition that sometimes means script detects game is
over but doesn't communicate to relay: don't consider file done until
have info to sent to relay.
2011-06-30 19:37:37 -07:00
Eric House
ef9d359ab9 tweak default param values 2011-06-29 21:38:54 -07:00
Andy2
363acc228a use printf so rooms sort numerically 2011-06-28 17:38:59 -07:00
Andy2
b2a7acbdf1 remove echo 2011-06-27 18:59:36 -07:00
Andy2
3db0543994 work in absence of drop-nth-packet param 2011-06-27 18:57:27 -07:00
Andy2
8673c6a001 toward being able to verify that upgrading the relay won't hurt
in-play games: add ability to pick up games mid-play; don't sleep
before killing a device unless it's only been running less that the
minimum.
2011-06-27 18:32:30 -07:00
Andy2
a5bab1232f deal with changing connnames: use the last 2011-06-23 18:12:38 -07:00
Andy2
b4381e8403 drop-packets off, not on, by default 2011-06-22 18:17:47 -07:00
Andy2
c87df3ce16 add option to drop incoming packets randomly (rather than 1st, then
2nd, then 3rd etc.)
2011-06-20 18:55:57 -07:00
Andy2
9b4034f409 fix undefined variable by updating script before possibly deleting it 2011-06-16 18:35:08 -07:00
Andy2
3f7cd851f2 use new drop-nth-packet option, incrementing by 1 each time.
Currently this breaks the relay -- which must be fixed.
2011-06-15 06:49:15 -07:00
Eric House
cb3e33ef72 update for months-old param name changes 2011-06-14 05:46:27 -07:00
Eric House
4ae8c76959 break printed runtime into hours:minutes:seconds 2011-01-24 22:19:02 -08:00
Eric House
c4bf153d36 log reason game ended to game's logfile 2011-01-20 18:10:33 -08:00
Eric House
b3de3fc91e add --robot-iq param for testing 2011-01-10 18:18:35 -08:00
Andy2
fc23080120 param name has changed 2011-01-10 06:40:42 -08:00
Andy2
7fe5e43963 modify to use new long-only flags 2010-12-21 08:02:51 -08:00
Eric House
9fd4229384 pass host to rq too 2010-12-02 22:34:59 -08:00
Andy2
5bf87b3bea add function to invoke rq once for all the relayIDs in the set of
devices making up a game.  Actually using it make the script fail for
some reason and so it's commented out, but it helped to debug the
relay.
2010-11-23 18:12:11 -08:00
Andy2
2127394260 don't allow resignations below a certain point -- which happens to fix
divide-by-zero error.
2010-11-22 20:44:28 -08:00
Eric House
a1caaeb183 simulate games being deleted before they're finished 2010-11-18 22:27:46 -08:00
Eric House
f33466b6db exit with non-0 on failure so calling script/loop can exit too 2010-11-16 20:29:55 -08:00
Andy2
3b30aff613 use external relayID.sh script 2010-11-15 19:01:38 -08:00
Andy2
58cd93ef6f given a log file, generates an ID that can be passed with the -d
option to relay/rq.
2010-11-15 18:34:56 -08:00
Andy2
a69e2ad8be add test for device-gone notification by calling rq after gleaning
required params from logs.  So far testing only after game is over;
need to test mid-game deletion too.
2010-11-15 06:52:35 -08:00
Andy2
9026d5c149 remove obsolete script I keep accidentally invoking 2010-11-12 18:26:01 -08:00
Eric House
966616cbc4 throw in the public flags; disallow unset variables 2010-11-09 05:54:23 -08:00
Eric House
211e9ded7f TIMEOUT needs to be bigger for small NGAMES values 2010-10-18 20:18:24 -07:00
Eric House
38ae2faacc don't nuke bad files along with good 2010-10-14 22:17:34 -07:00
Eric House
c92d59fa53 games can be started with multiple dicts; saving of successful games/logs optional 2010-10-14 05:59:45 -07:00
Eric House
40a7a1b5a3 cleanup; track checked rooms rather than checking each time seen 2010-10-12 19:17:42 -07:00
Eric House
8011eeec2c cleanup; fix off-by-one bug with NAMES that was breaking runs with
four-device games; check before run that there aren't already waiting
games in db.
2010-10-12 05:17:32 -07:00
Eric House
6c5b279946 respect TIMEOUT, and kill all remaining processes before exiting 2010-10-05 20:58:29 -07:00
Andy2
31f3cbc6c8 complete rewrite: use bash's new associative arrays to track games and
pids etc. so that a single process can manage starting and stopping
all games.  Fixes race conditions where a game would be killed after
finishing but before it'd sent out the message that would allow other
games to finish.
2010-10-04 22:16:58 -07:00
Eric House
1bfdd1978e move log directory away each time 2010-09-24 20:19:12 -07:00
Andy2
35ff5a7835 exit on logdir being gone before grepping it 2010-09-23 06:41:37 -07:00
Andy2
451ced44ba cleanup: shorter timeout; set aside games that finish correctly 2010-09-23 06:29:55 -07:00
Eric House
659278448b changes to work against remote relay 2010-09-22 05:45:40 -07:00
Eric House
076b211cab tweak to allow to specify host/port for use against remote relay 2010-09-21 20:38:54 -07:00
Eric House
b6ce74be1c add timeout after which all games are killed 2010-09-20 22:08:51 -07:00
Andy2
d199ec5168 account for possibility client apps won't exit on TERM 2010-09-20 05:33:58 -07:00
Andy2
54512b9e11 put logs in own dir 2010-09-18 07:35:16 -07:00
Andy2
eec07649a6 put logs in own dir; echo every time game ends successfully. 2010-09-18 07:35:02 -07:00
Andy2
7e1066dbcc vary room names 2010-09-16 22:20:43 -07:00
Andy2
76e7459a6d various improvements, e.g. random sleeps before and after starting 2010-09-16 18:56:34 -07:00
Andy2
ca6039e890 new test script attempting to mimic real-world usage 2010-09-16 05:39:50 -07:00
Andy2
0d7165f881 add ability to run gtk from newrelay.sh. Trying to run 50 instances
crashes the relay as ACKs take too long to come back.
2010-09-16 01:44:54 -07:00
Andy2
86a1e943ca make dict settable too 2010-09-12 03:53:39 -07:00
Andy2
1cd2d542f7 new test script 2010-09-11 01:39:20 -07:00
eehouse
f501ccd946 add better missing-param messages 2010-04-20 02:39:06 +00:00
ehouse
daa84bf4e2 include date in output 2010-03-31 02:46:29 +00:00