You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: instrumentation/github.com/confluentinc/confluent-kafka-go/kafka/splunkkafka/test/kafka_test.go
+72-19Lines changed: 72 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,8 @@
12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
-
//go:build cgo && (linux || darwin)
16
-
// +build cgo
17
-
// +build linux darwin
15
+
//go:build cgo && linux
16
+
// +build cgo,linux
18
17
19
18
package test
20
19
@@ -47,7 +46,54 @@ var (
47
46
testTopic="gotest"
48
47
)
49
48
50
-
funcTestSynchronous(t*testing.T) {
49
+
funcTestChannelBasedProducer(t*testing.T) {
50
+
defergoleak.VerifyNone(t)
51
+
52
+
partition:=int32(0)
53
+
sr, opts:=newFixtures()
54
+
p:=newProducer(t, opts...)
55
+
56
+
done:=make(chanstruct{})
57
+
varsent*kafka.Message
58
+
gofunc() {
59
+
deferclose(done)
60
+
sent=requireEventIsMessage(t, <-p.Events())
61
+
}()
62
+
gofunc() {
63
+
p.ProduceChannel() <-&kafka.Message{
64
+
TopicPartition: kafka.TopicPartition{
65
+
Topic: &testTopic,
66
+
Partition: partition,
67
+
},
68
+
Key: key,
69
+
Value: val,
70
+
}
71
+
}()
72
+
73
+
// Wait for the delivery report goroutine to finish.
0 commit comments