Skip to content

[fix][broker] Avoid Project access in broker test setup#25529

Merged
lhotari merged 2 commits into
apache:masterfrom
nodece:fix-broker-test-config-cache
Apr 17, 2026
Merged

[fix][broker] Avoid Project access in broker test setup#25529
lhotari merged 2 commits into
apache:masterfrom
nodece:fix-broker-test-config-cache

Conversation

@nodece
Copy link
Copy Markdown
Member

@nodece nodece commented Apr 15, 2026

Motivation

Broker tests configured NAR and JAR paths through rootProject.project(...) inside the test task action. That captures Gradle Project objects in the task configuration and breaks configuration cache for :pulsar-broker:test.

1 problem was found storing the configuration cache.
- Task `:pulsar-broker:test` of type `org.gradle.api.tasks.testing.Test`: cannot serialize object of type 'org.gradle.api.internal.project.DefaultProject', a subtype of 'org.gradle.api.Project', as these are not supported with the configuration cache.
  See https://docs.gradle.org/9.4.1/userguide/configuration_cache_requirements.html#config_cache:requirements:disallowed_types

Changes

  • replace broker test cross-project task lookups with resolvable dependency configurations
  • resolve required broker test NAR and JAR artifacts through resolvedArtifacts
  • keep the existing test system properties while making the test task compatible with configuration cache

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@nodece nodece force-pushed the fix-broker-test-config-cache branch from 051d992 to e5988fe Compare April 15, 2026 14:11
Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Copy link
Copy Markdown
Member

@lhotari lhotari left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check this before merging:

  Gradle suite > Gradle test > org.apache.pulsar.functions.worker.PulsarFunctionMetadataStoreTest > setup FAILED
      java.lang.AssertionError: /home/runner/work/pulsar/pulsar/pulsar-io/data-generator/build/libs/pulsar-io-data-generator-4.3.0-SNAPSHOT.nar doesn't exist. expected [true] but found [false]

@nodece
Copy link
Copy Markdown
Member Author

nodece commented Apr 17, 2026

@lhotari Good catch, this issue has been fixed.

@nodece nodece requested a review from lhotari April 17, 2026 04:11
@lhotari lhotari merged commit a4c291f into apache:master Apr 17, 2026
42 checks passed
@nodece nodece deleted the fix-broker-test-config-cache branch April 17, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants