1
0
Fork 0
firefox/third_party/rust/glean/tests/test-shutdown-blocking.sh
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

29 lines
738 B
Bash
Executable file

#!/bin/bash
# Test harness for testing the RLB processes from the outside.
#
# Some behavior can only be observed when properly exiting the process running Glean,
# e.g. when an uploader runs in another thread.
# On exit the threads will be killed, regardless of their state.
# Remove the temporary data path on all exit conditions
cleanup() {
if [ -n "$datapath" ]; then
rm -r "$datapath"
fi
}
trap cleanup INT ABRT TERM EXIT
tmp="${TMPDIR:-/tmp}"
datapath=$(mktemp -d "${tmp}/glean_long_running.XXXX")
cargo run -p glean --example long-running -- "$datapath"
count=$(ls -1q "$datapath/pending_pings" | wc -l)
if [[ "$count" -eq 0 ]]; then
echo "test result: ok."
exit 0
else
echo "test result: FAILED."
exit 101
fi