Skip to content

Commit b9f7e48

Browse files
committed
fix: address CodeRabbit review on PR #19
- fuzz-test.sh: add lob-logminer to help text, show down-before-up workflow - kafka-consumer.py: wait for all 3 topics before subscribing, fail on missing - perf/docker-compose.yaml: use ${VM_HOST:?} for fail-fast on missing env var - validator.py: normalize table name (strip schema, uppercase) for LOB detection - .env: clarify VM_HOST must be sourced from vm-env.sh - rac.sh: auto-source vm-env.sh when VM_HOST is not set
1 parent e4fa21a commit b9f7e48

6 files changed

Lines changed: 18 additions & 9 deletions

File tree

tests/dbz-twin/rac/fuzz-test.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@
1212
# run [duration-min] Deploy fuzz workload and run for N minutes (default: 30)
1313
# status Show consumer/validator status and OLR memory
1414
# validate Run validator (wait for idle timeout, report results)
15-
# logs [component] Show logs (kafka, logminer, olr, consumer, validator, olr-vm)
15+
# logs [component] Show logs (kafka, logminer, olr, lob-logminer, consumer, validator, olr-vm)
1616
# down Stop and remove all containers + volumes
1717
# help Show this help
1818
#
1919
# Typical workflow:
20-
# ./fuzz-test.sh up # start infrastructure
21-
# ./fuzz-test.sh run 60 # run 60-minute fuzz workload
20+
# ./fuzz-test.sh down # clean up any previous run
21+
# ./fuzz-test.sh up # start infrastructure
22+
# ./fuzz-test.sh run 60 # run 60-minute fuzz workload
2223
# ./fuzz-test.sh status # check progress
2324
# ./fuzz-test.sh validate # wait for drain + validate
2425
# ./fuzz-test.sh logs validator # investigate mismatches

tests/dbz-twin/rac/kafka-consumer.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,12 +146,16 @@ def main():
146146
# Wait for topics to appear, then subscribe
147147
all_topics = [LM_TOPIC, OLR_TOPIC, OLR_LOB_TOPIC]
148148
print(f"Waiting for topics: {', '.join(all_topics)}...", flush=True)
149-
for attempt in range(60):
149+
for _ in range(60):
150150
topics = consumer.topics()
151-
if LM_TOPIC in topics or OLR_TOPIC in topics:
152-
print(f" Found topics: {[t for t in all_topics if t in topics]}", flush=True)
151+
if all(t in topics for t in all_topics):
152+
print(f" Found all topics: {all_topics}", flush=True)
153153
break
154154
time.sleep(5)
155+
else:
156+
missing = [t for t in all_topics if t not in topics]
157+
print(f"ERROR: Missing Kafka topics after 5 min: {missing}", flush=True)
158+
sys.exit(1)
155159

156160
consumer.subscribe(all_topics)
157161
# Force metadata refresh

tests/dbz-twin/rac/perf/docker-compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
# Override with: docker compose run swingbench -uc 8 -rt 01:00.00
4545
command:
4646
- "-cs"
47-
- "//${VM_HOST}:1521/ORCLPDB"
47+
- "//${VM_HOST:?VM_HOST is required}:1521/ORCLPDB"
4848
- "-u"
4949
- "soe"
5050
- "-p"

tests/dbz-twin/rac/validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ def main():
245245
"SELECT table_name FROM olr_events WHERE event_id = ? LIMIT 1",
246246
(eid,)).fetchone()
247247
event_table = tbl_row['table_name'] if tbl_row else '?'
248-
is_lob = event_table in LOB_TABLES
248+
is_lob = event_table.split('.')[-1].upper() in LOB_TABLES
249249

250250
if in_lm and not in_olr:
251251
total_missing_olr += 1

tests/environments/rac/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# DB_CONN is set by the rac driver (tests/sql/scripts/drivers/rac.sh)
2-
# VM_HOST is auto-detected by vm-env.sh
2+
# VM_HOST must be set before running RAC tests — source vm-env.sh first
33
PDB_NAME=ORCLPDB
44
INCLUDE_TAGS=rac

tests/sql/scripts/drivers/rac.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ DB_CONN="olr_test/olr_test@//racnodep1:1521/ORCLPDB"
3636
source "$SCRIPT_DIR/drivers/base.sh"
3737

3838
# ---- RAC configuration ----
39+
if [[ -z "${VM_HOST:-}" ]]; then
40+
# shellcheck source=/dev/null
41+
source "$PROJECT_ROOT/tests/environments/rac/vm-env.sh"
42+
fi
3943
VM_HOST="${VM_HOST:?VM_HOST is required — source tests/environments/rac/vm-env.sh}"
4044
VM_KEY="${VM_KEY:-$PROJECT_ROOT/oracle-rac/assets/vm-key}"
4145
VM_USER="${VM_USER:-root}"

0 commit comments

Comments
 (0)