Skip to content

Commit 065b05f

Browse files
committed
Merge remote-tracking branch 'apache/main' into bewaremypower/enable-batch-default
2 parents 63a9907 + 43792ea commit 065b05f

File tree

11 files changed

+65
-38
lines changed

11 files changed

+65
-38
lines changed

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ set(CMAKE_PREFIX_PATH ${PROJECT_SOURCE_DIR}/pybind11/include ${CMAKE_PREFIX_PATH
2525
option(LINK_STATIC "Link against static libraries" OFF)
2626
MESSAGE(STATUS "LINK_STATIC: " ${LINK_STATIC})
2727

28+
if (NOT CMAKE_BUILD_TYPE)
29+
set(CMAKE_BUILD_TYPE Release)
30+
endif ()
2831
MESSAGE(STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE})
2932
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
3033
find_package(Threads REQUIRED)

pkg/manylinux2014/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ENV PATH="/opt/python/${PYTHON_SPEC}/bin:${PATH}"
3232
ENV PYTHON_INCLUDE_DIR /opt/python/${PYTHON_SPEC}/include
3333
ENV PYTHON_LIBRARIES /opt/python/${PYTHON_SPEC}/lib/python${PYTHON_VERSION}
3434

35-
RUN pip3 install pyyaml
35+
RUN pip3 install pyyaml setuptools
3636

3737
ADD .build/dependencies.yaml /
3838
ADD .build/dep-version.py /usr/local/bin

pkg/manylinux_musl/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ ENV PATH="/opt/python/${PYTHON_SPEC}/bin:${PATH}"
3333
ENV PYTHON_INCLUDE_DIR /opt/python/${PYTHON_SPEC}/include
3434
ENV PYTHON_LIBRARIES /opt/python/${PYTHON_SPEC}/lib/python${PYTHON_VERSION}
3535

36-
RUN pip install pyyaml
36+
RUN pip install pyyaml setuptools
3737

3838
RUN apk add cmake
3939

pulsar/functions/serde.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"""
4040
SerDe defines the interface for serialization/deserialization.
4141
42-
Everytime a message is read from pulsar topic, the serde is invoked to
42+
Every time a message is read from pulsar topic, the serde is invoked to
4343
serialize the bytes into an object before invoking the process method.
4444
Anytime a python object needs to be written back to pulsar, it is
4545
serialized into bytes before writing.

tests/asyncio_test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
class AsyncioTest(IsolatedAsyncioTestCase):
3535

3636
async def asyncSetUp(self) -> None:
37-
self._client = Client(service_url)
37+
self._client = Client(service_url,
38+
operation_timeout_seconds=5)
3839

3940
async def asyncTearDown(self) -> None:
4041
await self._client.close()
@@ -62,7 +63,7 @@ async def test_create_producer_failure(self):
6263
await self._client.create_producer('tenant/ns/awaitio-test-send-failure')
6364
self.fail()
6465
except PulsarException as e:
65-
self.assertEqual(e.error(), pulsar.Result.AuthorizationError)
66+
self.assertEqual(e.error(), pulsar.Result.Timeout)
6667

6768
async def test_send_failure(self):
6869
producer = await self._client.create_producer('awaitio-test-send-failure')

tests/debug_logger_test.py

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
#!/usr/bin/env python3
2+
#
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
#
20+
21+
from unittest import TestCase, main
22+
import pulsar
23+
24+
class DebugLoggerTest(TestCase):
25+
26+
def test_configure_log_level(self):
27+
client = pulsar.Client(
28+
service_url="pulsar://localhost:6650",
29+
logger=pulsar.ConsoleLogger(pulsar.LoggerLevel.Debug)
30+
)
31+
32+
producer = client.create_producer(
33+
topic='test_log_level'
34+
)
35+
36+
producer.send(b'hello')
37+
38+
def test_configure_log_to_file(self):
39+
client = pulsar.Client(
40+
service_url="pulsar://localhost:6650",
41+
logger=pulsar.FileLogger(pulsar.LoggerLevel.Debug, 'test.log')
42+
)
43+
44+
producer = client.create_producer(
45+
topic='test_log_to_file'
46+
)
47+
48+
producer.send(b'hello')
49+
50+
if __name__ == "__main__":
51+
main()

tests/pulsar_test.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151

5252
from _pulsar import ProducerConfiguration, ConsumerConfiguration, RegexSubscriptionMode
5353

54-
from schema_test import *
55-
from reader_test import *
56-
5754
from urllib.request import urlopen, Request
5855

5956
TM = 10000 # Do not wait forever in tests
@@ -1430,29 +1427,6 @@ def test_json_schema_encode(self):
14301427
second_encode = schema.encode(record)
14311428
self.assertEqual(first_encode, second_encode)
14321429

1433-
def test_configure_log_level(self):
1434-
client = pulsar.Client(
1435-
service_url="pulsar://localhost:6650",
1436-
logger=pulsar.ConsoleLogger(pulsar.LoggerLevel.Debug)
1437-
)
1438-
1439-
producer = client.create_producer(
1440-
topic='test_log_level'
1441-
)
1442-
1443-
producer.send(b'hello')
1444-
1445-
def test_configure_log_to_file(self):
1446-
client = pulsar.Client(
1447-
service_url="pulsar://localhost:6650",
1448-
logger=pulsar.FileLogger(pulsar.LoggerLevel.Debug, 'test.log')
1449-
)
1450-
1451-
producer = client.create_producer(
1452-
topic='test_log_to_file'
1453-
)
1454-
1455-
producer.send(b'hello')
14561430

14571431
def test_logger_thread_leaks(self):
14581432
def _do_connect(close):

tests/run-unit-tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ ROOT_DIR=$(git rev-parse --show-toplevel)
2424
cd $ROOT_DIR/tests
2525

2626
python3 custom_logger_test.py
27+
python3 debug_logger_test.py
2728
python3 interrupted_test.py
2829
python3 pulsar_test.py
30+
python3 schema_test.py
31+
python3 reader_test.py
2932
python3 asyncio_test.py

tests/schema_test.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#
2020

2121
import math
22-
import logging
2322
import requests
2423
from typing import List
2524
from unittest import TestCase, main
@@ -31,10 +30,6 @@
3130
import json
3231
from fastavro.schema import load_schema
3332

34-
logging.basicConfig(level=logging.INFO,
35-
format='%(asctime)s %(levelname)-5s %(message)s')
36-
37-
3833
class ExampleRecord(Record):
3934
str_field = String()
4035
int_field = Integer()

tests/test-conf/standalone-ssl.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ acknowledgmentAtBatchIndexLevelEnabled=true
121121
# Authentication plugin to use when connecting to bookies
122122
bookkeeperClientAuthenticationPlugin=
123123

124-
# BookKeeper auth plugin implementatation specifics parameters name and values
124+
# BookKeeper auth plugin implementation specifics parameters name and values
125125
bookkeeperClientAuthenticationParametersName=
126126
bookkeeperClientAuthenticationParameters=
127127

0 commit comments

Comments
 (0)