fluvio-community / fluvio-community/http-source-connector
WebSocket tests are flaky
- Dominant language
- Shell
- Stars
- 9
- Forks
- 6
- PR merge metrics
- No merged PRs in 30d
Description
When working on #244 and #245, I noticed that the tests can fail successfully if no messages are produced.
```bash
@test "websocket-connector-test" {
count=1
echo "Starting consumer on topic $TOPIC"
sleep 13
fluvio consume -B -d $TOPIC | while read input; do
expected="Hello, Fluvio! - $count"
echo $input = $expected
[ "$input" = "$expected" ]
count=$(($count + 1))
if [ $count -eq 10 ]; then
break;
fi
done
}
```
If `fluvio consume -B -d $TOPIC` produced no lines, nothing gets tested. I tested a new method that I think works pretty well:
```bash
@test "websocket-connector-test" {
count=1
echo "Starting consumer on topic $TOPIC"
sleep 13
expected=<
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.