pulsar.client.test package

Submodules

pulsar.client.test.check module

Script used to run an example job against a running Pulsar server.

Exercises various features both the Pulsar client and server.

class pulsar.client.test.check.ClientInfo(client, client_manager)

Bases: tuple

client

Alias for field number 0

client_manager

Alias for field number 1

class pulsar.client.test.check.MockTool(tool_dir)[source]

Bases: object

class pulsar.client.test.check.TestRequiredFilesObject[source]

Bases: object

find_required_files(tool_directory)[source]
class pulsar.client.test.check.Waiter(client, client_manager)[source]

Bases: object

shutdown()[source]
wait(seconds=120)[source]
pulsar.client.test.check.client_info(options, client_options, job_id=None)[source]

From command-line arguments options - extract options related to build a client manager and build it. Then get a client with supplied client options and optional job id.

pulsar.client.test.check.client_manager_from_args(options)[source]
pulsar.client.test.check.extract_client_options(options)[source]

Exract options explicitly related to build client from configured client manager.

pulsar.client.test.check.main(argv=None)[source]

Exercises a running Pulsar with the Pulsar client.

pulsar.client.test.check.run(options)[source]

pulsar.client.test.test_common module

For code shared between test_utils.py and check.py. Not sure this is the best place - but check needs to not depend on test_utils so run_client_tests can execute without webob dependency.

pulsar.client.test.test_common.write_config(has_temp_directory, data, name='config.json')[source]

pulsar.client.test.test_relay_transport module

Tests for the relay transport implementation.

Tests retry logic and message ID tracking functionality.

class pulsar.client.test.test_relay_transport.TestMessageIDTracking[source]

Bases: object

Test message ID tracking functionality.

test_long_poll_only_includes_since_for_requested_topics()[source]

Test that since only includes tracked IDs for topics in the request.

test_long_poll_tracks_message_ids()[source]

Test that long_poll tracks message IDs per topic.

test_long_poll_uses_tracked_message_ids_in_since()[source]

Test that long_poll includes tracked message IDs in the since parameter.

class pulsar.client.test.test_relay_transport.TestRetryLogic(methodName='runTest')[source]

Bases: TestCase

Test retry logic with exponential backoff.

test_post_message_does_not_retry_on_400_error()[source]

Test that post_message does NOT retry on 4xx client errors.

test_post_message_retries_on_500_error(mock_sleep)[source]

Test that post_message retries on 5xx server errors.

test_post_message_retries_on_connection_error(mock_sleep)[source]

Test that post_message retries indefinitely on connection errors.

test_post_message_retries_on_timeout(mock_sleep)[source]

Test that post_message retries on timeout.

test_retry_backoff_caps_at_max_delay(mock_sleep)[source]

Test that exponential backoff caps at max_delay.

Module contents