From bf082115ba1fe98c5bac6b729207ae4440e0cbe4 Mon Sep 17 00:00:00 2001 From: insleker Date: Fri, 10 Apr 2026 11:21:35 +0800 Subject: [PATCH] test: stabilize parallel event-source coverage (#37) --- .github/workflows/unittest.yaml | 2 +- README.md | 2 +- test/core/concurrency_test.dart | 4 ++-- test/core/retry_test.dart | 2 +- test/issue_event_source/github_gosmee_test.dart | 2 +- test/issue_event_source/gitlab_gosmee_test.dart | 2 +- test/issue_event_source/gosmee_test.dart | 4 ++-- test/issue_event_source/webhook_forward_test.dart | 6 +++--- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/unittest.yaml b/.github/workflows/unittest.yaml index c5dff75..0a54efe 100644 --- a/.github/workflows/unittest.yaml +++ b/.github/workflows/unittest.yaml @@ -26,4 +26,4 @@ jobs: run: dart run tool/validate_gherkin_test_format.dart - name: Run tests - run: dart test -j 1 + run: dart test diff --git a/README.md b/README.md index a6de167..a1e723d 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ dart run bin/code_work_spawner.dart \ ```bash dart run tool/validate_gherkin_test_format.dart dart analyze -dart test -j 1 +dart test ``` ## ref diff --git a/test/core/concurrency_test.dart b/test/core/concurrency_test.dart index 42995de..a587b53 100644 --- a/test/core/concurrency_test.dart +++ b/test/core/concurrency_test.dart @@ -108,13 +108,13 @@ void registerIssueAssistantAppRunOnceConcurrencyTests() { ghLog: ghLog, ); - // And a responder that sleeps for one second while logging each issue number. + // And a responder that sleeps long enough to expose overlap despite scheduler jitter. final eventLog = File(p.join(sandbox.path, 'responder-events.log')); final responderScript = File(p.join(sandbox.path, 'responder-slow.sh')); await writeDelayedLoggingResponderScript( responderScript, eventLog: eventLog, - delay: const Duration(seconds: 1), + delay: const Duration(seconds: 2), response: { 'decision': 'reply', 'mode': 'planning', diff --git a/test/core/retry_test.dart b/test/core/retry_test.dart index 542a012..64957de 100644 --- a/test/core/retry_test.dart +++ b/test/core/retry_test.dart @@ -92,7 +92,7 @@ projects: // When the long-running app starts and enough time passes for a retry. final runFuture = app.run(); - for (var attempt = 0; attempt < 60; attempt += 1) { + for (var attempt = 0; attempt < 200; attempt += 1) { final logLines = await ghLog.exists() ? await ghLog.readAsLines() : const []; diff --git a/test/issue_event_source/github_gosmee_test.dart b/test/issue_event_source/github_gosmee_test.dart index c4da084..7a8ad11 100644 --- a/test/issue_event_source/github_gosmee_test.dart +++ b/test/issue_event_source/github_gosmee_test.dart @@ -123,7 +123,7 @@ projects: // When the long-running app starts and receives the forwarded webhook. final runFuture = app.run(); - for (var attempt = 0; attempt < 50; attempt += 1) { + for (var attempt = 0; attempt < 200; attempt += 1) { if (await postedBody.exists()) { break; } diff --git a/test/issue_event_source/gitlab_gosmee_test.dart b/test/issue_event_source/gitlab_gosmee_test.dart index 39c7eda..5807240 100644 --- a/test/issue_event_source/gitlab_gosmee_test.dart +++ b/test/issue_event_source/gitlab_gosmee_test.dart @@ -137,7 +137,7 @@ projects: // When the long-running app starts and receives the forwarded webhook. final runFuture = app.run(); - for (var attempt = 0; attempt < 50; attempt += 1) { + for (var attempt = 0; attempt < 200; attempt += 1) { if (await postedBody.exists()) { break; } diff --git a/test/issue_event_source/gosmee_test.dart b/test/issue_event_source/gosmee_test.dart index c2647ea..8db40d0 100644 --- a/test/issue_event_source/gosmee_test.dart +++ b/test/issue_event_source/gosmee_test.dart @@ -165,7 +165,7 @@ projects: // When the long-running app starts and receives the forwarded webhook. final runFuture = app.run(); - for (var attempt = 0; attempt < 50; attempt += 1) { + for (var attempt = 0; attempt < 200; attempt += 1) { if (await postedBody.exists()) { break; } @@ -374,7 +374,7 @@ projects: // When the long-running app starts and enough time passes for reconciliation polling. final runFuture = app.run(); - for (var attempt = 0; attempt < 50; attempt += 1) { + for (var attempt = 0; attempt < 200; attempt += 1) { if (await postedBody.exists()) { break; } diff --git a/test/issue_event_source/webhook_forward_test.dart b/test/issue_event_source/webhook_forward_test.dart index 9871183..5d86cc4 100644 --- a/test/issue_event_source/webhook_forward_test.dart +++ b/test/issue_event_source/webhook_forward_test.dart @@ -103,7 +103,7 @@ projects: // When the long-running app starts and receives the forwarded webhook. final runFuture = app.run(); - for (var attempt = 0; attempt < 50; attempt += 1) { + for (var attempt = 0; attempt < 200; attempt += 1) { if (await postedBody.exists()) { break; } @@ -208,7 +208,7 @@ projects: // When the long-running app starts and webhook-forward emits that stderr line. final runFuture = app.run(); - for (var attempt = 0; attempt < 50; attempt += 1) { + for (var attempt = 0; attempt < 200; attempt += 1) { if (records.any( (record) => record.message.contains('error creating webhook'), )) { @@ -384,7 +384,7 @@ projects: // When the long-running app starts and enough time passes for reconciliation polling. final runFuture = app.run(); - for (var attempt = 0; attempt < 50; attempt += 1) { + for (var attempt = 0; attempt < 200; attempt += 1) { if (await postedBody.exists()) { break; }