5630: Fix integration tests hanging on crashes r=def- a=ChillerDragon

When the client or server crash the fifo will be dead
then the cleanup command hangs at

	echo "quit" > client1.fifo

because the fifo is not responding and thus it is stuck there.
which causes the user to probably ctrl+c at some point
which then avoids client2 to be quit which might not have crashed

So this commit checks if a fail_client1.txt file exits and if it crashed
already it will skip the call to the broken fifo

<!-- What is the motivation for the changes of this pull request -->

## Checklist

- [x] Tested the change ingame
- [ ] Provided screenshots if it is a visual change
- [ ] Tested in combination with possibly related configuration options
- [x] Written a unit test (especially base/) or added coverage to integration test
- [ ] Considered possible null pointers and out of bounds array indexing
- [ ] Changed no physics that affect existing maps
- [ ] Tested the change with [ASan+UBSan or valgrind's memcheck](https://github.com/ddnet/ddnet/#using-addresssanitizer--undefinedbehavioursanitizer-or-valgrinds-memcheck) (optional)


Co-authored-by: ChillerDragon <ChillerDragon@gmail.com>
This commit is contained in:
bors[bot] 2022-07-13 15:31:36 +00:00 committed by GitHub
commit 944c80a6e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -55,9 +55,20 @@ function kill_all() {
fi
sleep 1
echo "shutdown" > server.fifo
echo "quit" > client1.fifo
echo "quit" > client2.fifo
if [[ ! -f fail_server.txt ]]
then
echo "[*] shutting down server"
echo "shutdown" > server.fifo
fi
local i
for ((i=1;i<3;i++))
do
if [[ ! -f fail_client$i.txt ]]
then
echo "[*] shutting down client$i"
echo "quit" > "client$i.fifo"
fi
done
}
function cleanup() {