]> git.ipfire.org Git - thirdparty/git.git/commit
git p4 test: simplify timeout handling
authorSZEDER Gábor <szeder.dev@gmail.com>
Wed, 13 Mar 2019 12:24:17 +0000 (13:24 +0100)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Mar 2019 03:34:39 +0000 (12:34 +0900)
commit0e67c32955cee24c5ff534dd3f5f0de58ba91d02
tree947e5f77fb2fc47bada532c3c8900f4ed054fc01
parent07353d9042f19fec749ec8413ff7e6824460ee59
git p4 test: simplify timeout handling

'lib-git-p4.sh' uses timeouts in a watchdog process to kill a
potentially stuck 'p4d' process and for certain cleanup operation
between tests.  It does so by first computing when the timeout should
expire, and then repeatedly asking for the current time in seconds
until it exceeds the expiration time, and for portability reasons it
uses a one-liner Python script to ask for the current time.

Replace these timeouts with downcounters, which, though not
necessarily shorter, are much simpler, at least in the sense that they
don't execute the Python interpreter every second.

After this change the helper function with that Python one-liner has
no callers left, remove it.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-git-p4.sh