Repository navigation
[improve][test] Share the cluster between the classes of the Process and Schema integration suites - #27345
Open
merlimat wants to merge 1 commit into
Open
[improve][test] Share the cluster between the classes of the Process and Schema integration suites#27345merlimat wants to merge 1 commit into
merlimat wants to merge 1 commit into
Conversation
…and Schema integration suites The classes of pulsar-process.xml and pulsar-schema.xml each start a cluster of the default spec and stop it at their end. Once the Messaging and Cli jobs share their clusters, CI - System - Pulsar Connectors - Process is the last test job of a PR run. The Go, Java and Python process function test classes, and SchemaTest, JodaTimeTest and PythonSchemaTest, share their cluster (isClusterShared). Each function test class still starts and stops two function workers of its own. testSerdeFunction deletes its function, as the other function tests do: left registered, it stays assigned to the stopped worker of its class, and the leader of the next class's workers reschedules it onto them after a minute.
codelipenghui
approved these changes
Nov 4, 2026
codelipenghui
left a comment
Contributor
There was a problem hiding this comment.
Code Review approval for commit 5749c85.
Summary:
No actionable findings identified within the reviewed scope. The scoped cluster reuse preserves per-class function workers and removes the lingering serde registration. Compilation succeeded; runtime validation was blocked by Docker network address-pool exhaustion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
#27337 lets integration test classes that ask for the same cluster share one. With it, #27338 and #27339, the
Messaging and Cli jobs get a few minutes shorter. CI - System - Pulsar Connectors - Process then becomes, with
CI - Unit - Brokers - Broker Group 1, the last test job of a PR run: it took 14.2, 15.5 and 10.6 min in the PR runs
41555633313, 41674571977 and 41675073847 of 3 Nov.
It also starts 1-3.5 min after the Integration jobs, as it waits for the
pulsar-test-latest-versionimage.On CI the Process job runs
pulsar-process.xmlwith thefunctiongroup. Three classes run:PulsarFunctionsGoProcessTest,PulsarFunctionsJavaProcessTestandPulsarFunctionsPythonProcessTest. Each onestarts a cluster of the default spec plus two function workers, and stops them when it ends. On CI, 46-68 s pass
between the last test of one class and the first test of the next. The three classes of CI - System - Schema
(4.1-6.0 min) also ask for the default cluster, and lose 28-41 s between classes.
Modifications
Test code only.
pulsar-process.xmlthat run on CI share their cluster (isClusterShared()).PulsarFunctionsTestBasestops a class's workers in its teardown before thecluster is left running, and the next class starts two workers of its own. A class never finds another class's
workers or what still runs on them, such as the
localrunprocess thattestFunctionLocalRunstarts in a workercontainer.
testSerdeFunctiondeletes its function at the end, as every other test of these classes does (deleteFunctionbecomes protected). If it were left registered, the next class's leader would keep it assigned to the stopped
worker. Its membership monitor would then move it onto one of the leader's own workers once it has been on a dead
worker for longer than
rescheduleTimeoutMs(60 s, checked everyfailureCheckFreqMs, 30 s).SchemaTest,JodaTimeTestandPythonSchemaTestshare their cluster.Each of these classes asks for the default cluster. It creates namespaces and topics with generated names, or with
names that no other class of its suite uses (
SchemaTest'spublic/default/tp-ref, which it deletes, and its<schema><schema>topics). None of them stops, pauses or reconfigures a container, or changes a broker orcluster-wide setting.
In the other suites that CI runs, no two classes could share a cluster:
pulsar-thread.xml: onlyPulsarFunctionsJavaThreadTestruns on CI. The job selects thefunction,sourceandsinkgroups, andPulsarWorkerRebalanceDrainThreadTest's tests are in none of them. The same goes forPulsarWorkerRebalanceDrainProcessTestinpulsar-process.xml, which also adds and stops workers.pulsar-function.xml: standalone containers (PulsarStandaloneTestSuite), notPulsarClusterTestBase.pulsar-plugin.xml: each class configures a broker plugin of its own.pulsar-transaction.xml:TcMetadataDiscoveryTestandV5ScalableTopicTransactionTeststop a broker.TransactionTestconfigures the brokers for the legacy coordinator inbeforeStartCluster, andV5ScalableTopicTransactionOnOxiaTestruns on Oxia.pulsar-loadbalance.xml,pulsar-metrics.xml,tiered-*.xmlandpulsar-k8s.xmlhave one class each.pulsar-standalone.xml,pulsar-upgrade.xmlandpulsar-backwards-compatibility.xmlrun standalone, upgraded orper-version clusters, and in
pulsar-websocket.xmlandpulsar-tls.xmleach class asks for a spec of its own.Verifying this change
This change is covered by the existing integration tests: every class of
pulsar-process.xml(with-PtestGroups=function, as CI runs it) and ofpulsar-schema.xmlpasses.Local runs, on a 10-CPU Docker VM with an image built from apache/master. Each suite ran in a Gradle run of its own,
test retries on as on CI, and before and after runs alternated, as the host was busy (load average 6-24). The time
from the end of one class to the start of the next class's first test covers the teardown, which no class time shows,
plus the next class's setup:
PulsarFunctionsGoProcessTest->PulsarFunctionsJavaProcessTestPulsarFunctionsJavaProcessTest->PulsarFunctionsPythonProcessTestSchemaTest->JodaTimeTestJodaTimeTest->PythonSchemaTestFor the function test classes, what remains is stopping a class's two workers and starting the next class's two
(their containers start 2.6-4.1 s apart,
docker events). Test task times, which the busy host makes noisier:pulsar-process.xmlpulsar-schema.xmlOn CI, a cluster's setup takes 26-32 s (Develocity's class own time of the Schema classes, 2-3 Nov), and its stop
about 7 s. Each of the two jobs loses two setups and two stops, so the estimate is about 1 min less for each.
Checked as well, with mutations that are not committed:
testSerdeFunctionwithout the delete, followed by the Python class: for the 84 s that the Python class's workersran, their leader listed the serde function's instance on the Java class's stopped worker (
"alive" : false). Withthe delete, the Python class's workers only replay the function's deletion.
setupFunctionWorkers()throwing in the Go class: the skipped tests mark the setup as failed, so the Go class'scluster and its retry's cluster are both stopped, and the Python class starts a cluster of its own.
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes