Skip to content

Optimize runs for Auto Validate Examples#1786

Draft
siri-varma wants to merge 7 commits into
dapr:masterfrom
siri-varma:users/svegiraju/parallel-examples-probe
Draft

Optimize runs for Auto Validate Examples#1786
siri-varma wants to merge 7 commits into
dapr:masterfrom
siri-varma:users/svegiraju/parallel-examples-probe

Conversation

@siri-varma

Copy link
Copy Markdown
Contributor

Description

Please explain the changes you've made

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

Introduce a standard and tooling to run the mm.py example-validation READMEs
concurrently against a single shared 'dapr init' runtime:

- examples/validate/PARALLEL_STANDARD.md: the isolation standard (unique
  slug-prefixed app-ids -> free Redis state isolation, omit dapr ports so the
  CLI auto-assigns, unique app-ports for server apps, namespaced topics/actor
  types).
- examples/validate/run-parallel.sh: bounded-concurrency mm.py runner with
  per-README logs, per-README retry, and exit-code aggregation.
- examples/validate/check-parallel-safe.sh: static checker enforcing the rules.
- examples/validate/readmes.txt: canonical README list.

Migrate a 3-README pilot (state, invoke/http, pubsub) to the standard and add a
TEMPORARY push-triggered probe workflow that runs them sequentially then in
parallel on one shared runtime to confirm auto-ports, isolation, and speedup.
The probe workflow is not intended for master.

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Dapr only exposes a scoped component to the app-ids in its 'scopes:' list.
The pilot renamed the pubsub app-ids but not the scopes in
components/pubsub/redis_messagebus.yaml, so daprd reported
'pubsub messagebus is not found'. Update scopes to the renamed app-ids and
document the component-scopes rule in PARALLEL_STANDARD.md.

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
Complete the parallel-safe migration across every example validated by mm.py:
- Unique slug-prefixed app-ids (Rule 1) -> free Redis state-key isolation.
- Unique app-ports from the port registry for server apps; drop hardcoded
  default dapr ports so the CLI auto-assigns (Rule 2).
- Namespaced pub/sub topic for pubsub/stream so it no longer collides with the
  pubsub example on the shared broker (Rule 3).
- Component scopes in components/pubsub/redis_messagebus.yaml updated to the
  renamed pubsub and pubsub/stream app-ids.
- Java cascades updated in lockstep: invoke/http + invoke/grpc + tracing
  service-invocation target app-ids, tracing Zipkin span-name assertions,
  workflows multiapp child-workflow app-ids, jobs Spring --server.port.
- checker gains Rule 4 (component-scope app-ids must be slug-prefixed).

check-parallel-safe.sh now reports 0 violations across all 17 READMEs. Probe
workflow updated to run all 17 sequentially then in parallel on one dapr init.

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
@siri-varma siri-varma requested review from a team as code owners July 13, 2026 19:49
- validate.yml now runs the example READMEs concurrently on one shared dapr
  runtime via examples/validate/run-parallel.sh -j 4 (spring-boot-examples
  runs unchanged).
- check-parallel-safe.sh: add Rule 4 (component-scope app-ids must be
  slug-prefixed) so app-id renames can't silently break Dapr component scopes.
- Remove the temporary parallel-examples-probe.yml workflow (was only for
  validating this change on the branch; not intended for master).

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
crypto and jobs pin the Dapr sidecar ports in Java via withPropertyOverrides
(CryptoExample/StreamingCryptoExample -> 3500/50001; DemoJobsClient -> 3500/51439;
the jobs client runs without its own sidecar so it must hardcode). Dropping the
explicit --dapr-*-port flags moved the sidecar to auto-assigned ports while the
apps still dialed the old ones -> gRPC connection failure. Give each a unique
fixed port in its registry range and match the Java overrides:
  crypto  -> --dapr-http-port 3180 --dapr-grpc-port 3181
  jobs    -> --dapr-http-port 3261 --dapr-grpc-port 3262
Auto-assigned ports are high ephemeral, so these fixed low ports don't collide.

Also remove examples/validate/PARALLEL_STANDARD.md (rules stay documented in the
checker header) and fix the dangling references. Probe workflow re-added
temporarily to validate this fix + the full parallel run; will be removed once green.

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
The jobs example schedules a recurring job 'dapr-job-1' (cron '* * * * * *')
and never deletes it, so the Dapr scheduler retains it across runs. Re-running
(or retrying) the example then fails with ALREADY_EXISTS. Delete any existing
instance before scheduling so the example is re-runnable and safe under the
run-parallel per-README retry and validate.yml's retry wrapper. Concurrency
itself was fine: the -j 4 parallel run passed 16/17, only jobs collided.

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
The -j 4 parallel run passed 16/17 but the shared runner (JVM-heavy examples)
shows intermittent timeout/kill flakiness (~1 example/run). Lower concurrency to
-j 2 and raise per-README retries to 2 (3 attempts; safe now that jobs is
idempotent) for a reliable run; still ~1.7-2x faster than sequential. Probe now
emits parallel failures as GitHub error annotations for diagnosis.

Signed-off-by: Siri Varma Vegiraju <siri.varma@outlook.com>
@codecov

codecov Bot commented Jul 13, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.02%. Comparing base (2a036fe) to head (880abe9).

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #1786      +/-   ##
============================================
- Coverage     77.06%   77.02%   -0.05%     
  Complexity     2324     2324              
============================================
  Files           245      245              
  Lines          7198     7198              
  Branches        760      760              
============================================
- Hits           5547     5544       -3     
- Misses         1285     1288       +3     
  Partials        366      366              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@siri-varma siri-varma marked this pull request as draft July 13, 2026 21:24
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.

1 participant