fluvio-community / fluvio-community/http-source-connector

WebSocket tests are flaky

Open
#246 0 comments 1 reaction 0 assignees View on GitHub
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.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.