Skip to content

Commit 4253939

Browse files
committed
fix: test_socks5 was semi-broken
Kafka seems to be a bit forgiving with us and allows us to fetch from unknown partitions, but redpanda is quite strict (which is good) so we need to fix this test.
1 parent c5adf5f commit 4253939

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

tests/client.rs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,17 +125,35 @@ async fn test_socks5() {
125125
let connection = maybe_skip_kafka_integration!();
126126
// e.g. "localhost:1080"
127127
let proxy = maybe_skip_SOCKS_PROXY!();
128+
let topic_name = random_topic_name();
128129

129130
let client = ClientBuilder::new(connection)
130131
.socks5_proxy(proxy)
131132
.build()
132133
.await
133134
.unwrap();
134-
let partition_client = client.partition_client("myorg_mybucket", 0).unwrap();
135+
136+
let controller_client = client.controller_client().unwrap();
137+
controller_client
138+
.create_topic(&topic_name, 1, 1, 5_000)
139+
.await
140+
.unwrap();
141+
142+
let partition_client = client.partition_client(topic_name, 0).unwrap();
143+
144+
let record = record(b"");
135145
partition_client
146+
.produce(vec![record.clone()], Compression::NoCompression)
147+
.await
148+
.unwrap();
149+
150+
let (mut records, _watermark) = partition_client
136151
.fetch_records(0, 1..10_000_001, 1_000)
137152
.await
138153
.unwrap();
154+
assert_eq!(records.len(), 1);
155+
let record2 = records.remove(0).record;
156+
assert_eq!(record, record2);
139157
}
140158

141159
#[tokio::test]

0 commit comments

Comments
 (0)