Commit ac41379 1 parent 823d692 commit ac41379 Copy full SHA for ac41379
File tree 3 files changed +9
-6
lines changed
3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -121,7 +121,8 @@ func TestProducerConsumer(t *testing.T) {
121
121
122
122
func TestConsumerConnectError (t * testing.T ) {
123
123
client , err := NewClient (ClientOptions {
124
- URL : "pulsar://invalid-hostname:6650" ,
124
+ URL : "pulsar://invalid-hostname:6650" ,
125
+ OperationTimeout : 5 * time .Second ,
125
126
})
126
127
127
128
assert .Nil (t , err )
@@ -137,7 +138,7 @@ func TestConsumerConnectError(t *testing.T) {
137
138
assert .Nil (t , consumer )
138
139
assert .NotNil (t , err )
139
140
140
- assert .ErrorContains (t , err , "connection error " )
141
+ assert .ErrorContains (t , err , "failed to connect to broker " )
141
142
}
142
143
143
144
func TestBatchMessageReceive (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -58,7 +58,8 @@ func TestInvalidURL(t *testing.T) {
58
58
59
59
func TestProducerConnectError (t * testing.T ) {
60
60
client , err := NewClient (ClientOptions {
61
- URL : "pulsar://invalid-hostname:6650" ,
61
+ URL : "pulsar://invalid-hostname:6650" ,
62
+ OperationTimeout : 5 * time .Second ,
62
63
})
63
64
64
65
assert .Nil (t , err )
@@ -73,7 +74,7 @@ func TestProducerConnectError(t *testing.T) {
73
74
assert .Nil (t , producer )
74
75
assert .NotNil (t , err )
75
76
76
- assert .ErrorContains (t , err , "connection error " )
77
+ assert .ErrorContains (t , err , "failed to connect to broker " )
77
78
}
78
79
79
80
func TestProducerNoTopic (t * testing.T ) {
Original file line number Diff line number Diff line change @@ -205,7 +205,8 @@ func TestReaderOnPartitionedTopic(t *testing.T) {
205
205
206
206
func TestReaderConnectError (t * testing.T ) {
207
207
client , err := NewClient (ClientOptions {
208
- URL : "pulsar://invalid-hostname:6650" ,
208
+ URL : "pulsar://invalid-hostname:6650" ,
209
+ OperationTimeout : 5 * time .Second ,
209
210
})
210
211
211
212
assert .Nil (t , err )
@@ -221,7 +222,7 @@ func TestReaderConnectError(t *testing.T) {
221
222
assert .Nil (t , reader )
222
223
assert .NotNil (t , err )
223
224
224
- assert .ErrorContains (t , err , "connection error " )
225
+ assert .ErrorContains (t , err , "failed to connect to broker " )
225
226
}
226
227
227
228
func TestReaderOnSpecificMessage (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments