tisonkun commented on code in PR #930:
URL: https://github.com/apache/pulsar-client-go/pull/930#discussion_r1060261448


##########
pulsar/table_view_test.go:
##########
@@ -78,3 +78,67 @@ func TestTableView(t *testing.T) {
                assert.Equal(t, valuePrefix+k, *(v.(*string)))
        }
 }
+
+func TestPublishNilValue(t *testing.T) {
+       client, err := NewClient(ClientOptions{
+               URL: lookupURL,
+       })
+
+       assert.NoError(t, err)
+       defer client.Close()
+
+       topic := newTopicName()
+       schema := NewStringSchema(nil)
+
+       // create producer
+       producer, err := client.CreateProducer(ProducerOptions{
+               Topic:  topic,
+               Schema: schema,
+       })
+       assert.NoError(t, err)
+       defer producer.Close()
+
+       // create table view
+       v := ""
+       tv, err := client.CreateTableView(TableViewOptions{
+               Topic:           topic,
+               Schema:          schema,
+               SchemaValueType: reflect.TypeOf(&v),
+       })
+       assert.NoError(t, err)
+       defer tv.Close()
+
+       _, err = producer.Send(context.Background(), &ProducerMessage{
+               Key:   "key-1",
+               Value: "value-1",
+       })
+       assert.NoError(t, err)
+
+       for tv.Size() < 1 {
+               time.Sleep(time.Second * 1)
+       }

Review Comment:
   Since we have `stretchr/testify` in deps, it's possible to try 
`require.Eventually` as [I did in 
Kvrocks](https://github.com/apache/incubator-kvrocks/blob/52b0a6102d83d006a0e1dfc55f9d054036cd6df4/tests/gocase/util/client.go#L44-L57).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to