agentscope-java icon indicating copy to clipboard operation
agentscope-java copied to clipboard

[Bug]: JevCodeReviewTest 在 Windows CI 上不稳定:2 秒预算在慢 runner 上超时

Open littlebird69 opened this issue 1 month ago • 1 comments

Describe the bug

agentscope-examples/jev 里的 JevCodeReviewTest.completesSixStagesWithEvidenceBoundLineAndNoAutomaticReviewAction 在 Windows CI 上不稳定,会随机失败,导致和 jev 无关的 PR 的 build (windows-latest) 变红。

这个测试类的所有用例共用 options() 给出的 2 秒预算:

static JevExecution.Options options(JevExecution.Mode mode) {
    return new JevExecution.Options(mode, Duration.ofSeconds(2), "review-test", (ctx, r) -> {});
}

JevExecution 对整个评审流程施加 .timeout(options.budget()),超时后返回 Status.ERROR(reason 为 TIMEOUT)。这个用例虽然使用合成的即时应答,但它是测试类里第一个真正跑完六个阶段的用例,要承担类加载和 JIT 预热的开销。在较慢的 Windows runner 上,这部分开销就可能超过 2 秒。

To Reproduce

在 PR #3802 的 Windows CI 中出现,该 PR 只改了 agentscope-extensions-rag-simple:https://github.com/agentscope-ai/agentscope-java/actions/runs/40460210386/job/122042735397

[ERROR] JevCodeReviewTest.completesSixStagesWithEvidenceBoundLineAndNoAutomaticReviewAction -- Time elapsed: 2.537 s <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <DECIDED> but was: <ERROR>
	at ...JevCodeReviewTest.completesSixStagesWithEvidenceBoundLineAndNoAutomaticReviewAction(JevCodeReviewTest.java:137)

用例耗时 2.537 秒,超过了 2 秒预算。同一个 run 里,Ubuntu 构建通过。该 PR 的基线 de2dc8f3c 在 main 上的 Windows CI 也是通过的。

Expected behavior

这些用例验证的是评审流程的逻辑,不是耗时,结果不应该受 runner 速度影响。

Environment (please complete the following information):

  • AgentScope-Java Version: 2.1.0-SNAPSHOT (main @ de2dc8f3c)
  • Java Version: CI 配置的 JDK
  • OS: GitHub Actions windows-latest

Additional context

建议的修法:把功能用例的预算放宽,比如改成 30 秒。不过同一个类里有两个超时用例(约第 300–308 行),它们用 StepVerifier.withVirtualTime(...).thenAwait(Duration.ofSeconds(3)) 依赖这个 2 秒预算。所以可以:

  • 让 options() 接收预算参数,超时用例继续传 2 秒;
  • 或者在超时用例里相应地加大 thenAwait 的时长。

这两个超时用例用的是虚拟时间,放宽预算不会让测试变慢。

littlebird69 avatar Oct 27 '26 07:10 littlebird69

I'd like to take this test-only fix. I verified the linked Windows CI failure and confirmed current main still shares the two-second budget. I'll give functional cases a larger named budget while keeping explicit short budgets for the virtual-time timeout assertions, and add a virtual-time delayed-evidence regression so the distinction is exercised without making the suite slower. Production execution budgets and review assertions will stay unchanged.

breezeFur avatar Oct 28 '26 01:10 breezeFur