Repository navigation
test: remove fixed test waits on the CI critical path (~90s off module test time) - #2
Closed
xzxiaoshan wants to merge 3 commits into
Closed
xzxiaoshan wants to merge 3 commits into
xzxiaoshan wants to merge 3 commits into
Conversation
SchedulerAppContextLoadTest paid 55s per run sleeping through SchedulerChannelRuntime's default 12 x 5s control-plane retries against the unlistened test URL (localhost:8081). service-scheduler is the critical-path wall endpoint, so the saving lands ~1:1 on the Linux build step. Set builder.scheduler.channel-config-retries=1 in the test properties: one failed attempt yields the same "starting with zero channels" outcome (local run 85.7s -> 13.9s; production defaults unchanged). AsyncToolMiddlewareTest.toolExceedsTimeout_emitsPlaceholderAndOffloads waited a fixed 3s for the background inbox push that arrives ~2s after the offload. Replace the sleep with a bounded poll (5s deadline, 50ms interval) so the test finishes as soon as the push lands and keeps a safe margin on slow runners (the old fixed margin was ~0.3s).
WorkspaceMessageBus.subscribe() ticks at a hardcoded 3s (pub/sub is degraded to polling) and WaitAsyncResultsTool polls at a hardcoded 3s granularity, so every signal-driven test paid up to 3s per wait: WakeupDispatcherTest waited out two full ticks, the subscribe regression tests in WorkspaceMessageBusTest waited ~3s each for the first tick, and two completion-bound WaitAsyncResultsTool tests slept through their whole remaining budget after the tasks had completed at 150/300ms. Add injectable intervals with unchanged production defaults (3s): - WorkspaceMessageBus(filesystem, busRoot, pollInterval) public ctor; null/zero/negative falls back to the default - WaitAsyncResultsTool package-private (bus, repo, pollIntervalMs) and (bus, repo, clock, sleeper, pollIntervalMs) overloads Tests pass 50ms where the tick is the bottleneck. Local per-class: WakeupDispatcherTest 7.2s -> 1.2s, WorkspaceMessageBusTest 6.1s -> 0.2s, WaitAsyncResultsToolTest 12.1s -> 8.6s (the remainder is 1s-budget empty waits, i.e. the semantics under test). Harness verify: 1240 tests green.
- WaitAsyncResultsToolTest: convert 5 real-clock budget waits to the existing VirtualTime helper (8.6s -> 0.65s), timeout values unchanged - WorkspaceTaskRepository: add package-private setAwaitingConfirmPollMs test seam mirroring setTransport (production default 750ms unchanged); remote streaming tests inject 50ms (5.4s -> 0.96s) - Observation windows sized to iteration periods: AgentSpawnToolOrphanCancelTest 4s -> 1s (~150ms/iteration), SubAgentToolTimeoutRetryIntegrationTest 2s+2s -> 1.5s+0.75s - Replace fixed sleeps with bounded polling (25ms step, 5s cap): GracefulShutdownTest, TrainingRunnerTest - Negative-assertion windows sized to tick multiples: WakeupDispatcherTest 500ms x2 -> 300ms x2, MongoSandboxExecutionGuardTest 500+after(500) -> 300+after(300) - Fix stale comments/javadoc from the previous poll-seam commit Assertions and behavior under test are unchanged; each new duration is documented with its derivation. Verified: affected classes green, full harness module 1240 tests / 0 failures, spotless clean.
Owner
Author
|
Closing in favor of the upstream PR: agentscope-ai#3553 (this one was mistakenly created against the fork's own main). |
xzxiaoshan
added a commit
that referenced
this pull request
Nov 11, 2026
…_source semantics Review feedback #2 (scope reduction): the skillId format, default source and same-name merge changes were not required for the grant layer. - separator: SKILL_ID_SEPARATOR moves to SkillUtil and reverts to "_"; getSkillId() always composes name + "_" + source - restore the "custom" default source and the strict name charset (^[a-z0-9][a-z0-9-]*$, no underscores — PR agentscope-ai#3787) - catalogs merge by name again: same name keeps the higher-priority copy - grant vocabulary is the skill name: convention groups resolve by backward derivation (group name -> name part), activateOnSkill bindings expand at the call entry via the new SkillUtil.parseSkillName - allowedSkills additionally honours an exact full-skillId entry as a program-level compatibility (javadoc-documented; user docs stay name-only) Unconfigured behavior is unchanged from main; the grant layer (gates, filters, inheritance, ordering) is untouched.
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.
Background
The Linux CI build step is at 693s after agentscope-ai#3543; effective parallelism (~3.3/4) is near hardware saturation, so the remaining bottleneck is the dependency-chain critical path: Core(84s) → extensions → Harness(167s) → Service Common(78s) → … → Service Scheduler(119s, wall end). This PR removes deterministic wait waste from tests on that path (fixed sleeps, coarse polling, oversized observation windows). No assertion or behavior under test changes; production defaults are untouched.
Changes (3 commits)
SchedulerAppContextLoadTestsetsbuilder.scheduler.channel-config-retries=1— the 12×5s retry backoff was pure idle waiting in tests (local 85.65s → 13.89s); still boots with 0 channels. Production default (12 retries / 5s) unchanged.WorkspaceMessageBusheartbeat andWaitAsyncResultsToolpolling gained injectable constructors, andWorkspaceTaskRepositorya package-privatesetAwaitingConfirmPollMsseam (mirrors the existingsetTransporthook). Production defaults (3s / 3s / 750ms) unchanged; tests inject 50ms.WaitAsyncResultsToolTestuse the existingVirtualTimehelper (8.6s → 0.65s), timeout values unchangedAgentSpawnToolOrphanCancelTest4s → 1s (~150ms/iteration),SubAgentToolTimeoutRetryIntegrationTest2s+2s → 1.5s+0.75sGracefulShutdownTest,TrainingRunnerTest,AsyncToolMiddlewareTestWakeupDispatcherTest500ms×2 → 300ms×2,MongoSandboxExecutionGuardTest500+after(500) → 300+after(300)Verification
spotless:checkcleanmain(includes ci: cancel superseded PR runs and skip release-only jars on PR builds agentscope-ai/agentscope-java#3543);test-compilegreen after rebaseExpected impact
~−89s of module-level test time (Scheduler −55 / harness −32.5 / core −2.2); Linux build step 693s → ~600–610s (−13%). Sleep durations are wall-clock stable under CI contention, so the translation to wall time is ~1:1 for critical-path modules.
Test plan