Skip to content

Commit

Permalink
chore: run the local-resume-test 5 times
Browse files Browse the repository at this point in the history
  • Loading branch information
fraidev committed Sep 11, 2024
1 parent f830c30 commit ee697f9
Showing 1 changed file with 49 additions and 37 deletions.
86 changes: 49 additions & 37 deletions tests/local-resume-test.sh
Original file line number Diff line number Diff line change
@@ -1,38 +1,50 @@
# #!/bin/bash
${FLUVIO_BIN} cluster delete --force
rm -rf ~/.fluvio
${FLUVIO_BIN} cluster start --local

seq 1 10 | parallel -j 10 ${FLUVIO_BIN} topic create test-topic-{}
seq 1 10 | parallel -j 10 ${FLUVIO_BIN} remote register test-remote-{}

${FLUVIO_BIN} cluster shutdown
${FLUVIO_BIN} cluster resume

# Create topic
${FLUVIO_BIN} topic create test-topic-11 # THIS WAS HANGING

TOPIC_LIST=$(${FLUVIO_BIN} topic list 2>/dev/null)
PARTITION_LIST=$(${FLUVIO_BIN} partition list 2>/dev/null)
REMOTE_LIST=$(${FLUVIO_BIN} remote list 2>/dev/null)

# Check if the topic list has 11+1 lines
if [ $(echo "$TOPIC_LIST" | wc -l) -eq 12 ]; then
echo "PASS"
else
echo "FAIL"
fi

# Check if the partition list has 11+1 lines
if [ $(echo "$PARTITION_LIST" | wc -l) -eq 12 ]; then
echo "PASS"
else
echo "FAIL"
fi

# Check if the remote list has 10+1 lines
if [ $(echo "$REMOTE_LIST" | wc -l) -eq 11 ]; then
echo "PASS"
else
echo "FAIL"
fi

function run_test() {
${FLUVIO_BIN} cluster delete --force
# rm -rf ~/.fluvio
${FLUVIO_BIN} cluster start --local

seq 1 10 | parallel -j 10 ${FLUVIO_BIN} topic create test-topic-{}
seq 1 10 | parallel -j 10 ${FLUVIO_BIN} remote register test-remote-{}

${FLUVIO_BIN} cluster shutdown
${FLUVIO_BIN} cluster resume

# Create topic
${FLUVIO_BIN} topic create test-topic-11 # THIS WAS HANGING

TOPIC_LIST=$(${FLUVIO_BIN} topic list 2>/dev/null)
PARTITION_LIST=$(${FLUVIO_BIN} partition list 2>/dev/null)
REMOTE_LIST=$(${FLUVIO_BIN} remote list 2>/dev/null)

# Check if the topic list has 11+1 lines
if [ $(echo "$TOPIC_LIST" | wc -l) -eq 12 ]; then
echo "PASS"
else
echo "FAIL"
fi

# Check if the partition list has 11+1 lines
if [ $(echo "$PARTITION_LIST" | wc -l) -eq 12 ]; then
echo "PASS"
else
echo "FAIL"
fi

# Check if the remote list has 10+1 lines
if [ $(echo "$REMOTE_LIST" | wc -l) -eq 11 ]; then
echo "PASS"
else
echo "FAIL"
fi
}

function main() {
for i in {1..5}
do
run_test
done
}

main;

0 comments on commit ee697f9

Please sign in to comment.