test: stabilize parallel event-source coverage (#37)

This commit is contained in:
insleker 2026-04-10 11:21:35 +08:00
parent 1790de1f08
commit bf082115ba
8 changed files with 12 additions and 12 deletions

View File

@ -26,4 +26,4 @@ jobs:
run: dart run tool/validate_gherkin_test_format.dart run: dart run tool/validate_gherkin_test_format.dart
- name: Run tests - name: Run tests
run: dart test -j 1 run: dart test

View File

@ -82,7 +82,7 @@ dart run bin/code_work_spawner.dart \
```bash ```bash
dart run tool/validate_gherkin_test_format.dart dart run tool/validate_gherkin_test_format.dart
dart analyze dart analyze
dart test -j 1 dart test
``` ```
## ref ## ref

View File

@ -108,13 +108,13 @@ void registerIssueAssistantAppRunOnceConcurrencyTests() {
ghLog: ghLog, 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 eventLog = File(p.join(sandbox.path, 'responder-events.log'));
final responderScript = File(p.join(sandbox.path, 'responder-slow.sh')); final responderScript = File(p.join(sandbox.path, 'responder-slow.sh'));
await writeDelayedLoggingResponderScript( await writeDelayedLoggingResponderScript(
responderScript, responderScript,
eventLog: eventLog, eventLog: eventLog,
delay: const Duration(seconds: 1), delay: const Duration(seconds: 2),
response: { response: {
'decision': 'reply', 'decision': 'reply',
'mode': 'planning', 'mode': 'planning',

View File

@ -92,7 +92,7 @@ projects:
// When the long-running app starts and enough time passes for a retry. // When the long-running app starts and enough time passes for a retry.
final runFuture = app.run(); 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() final logLines = await ghLog.exists()
? await ghLog.readAsLines() ? await ghLog.readAsLines()
: const <String>[]; : const <String>[];

View File

@ -123,7 +123,7 @@ projects:
// When the long-running app starts and receives the forwarded webhook. // When the long-running app starts and receives the forwarded webhook.
final runFuture = app.run(); final runFuture = app.run();
for (var attempt = 0; attempt < 50; attempt += 1) { for (var attempt = 0; attempt < 200; attempt += 1) {
if (await postedBody.exists()) { if (await postedBody.exists()) {
break; break;
} }

View File

@ -137,7 +137,7 @@ projects:
// When the long-running app starts and receives the forwarded webhook. // When the long-running app starts and receives the forwarded webhook.
final runFuture = app.run(); final runFuture = app.run();
for (var attempt = 0; attempt < 50; attempt += 1) { for (var attempt = 0; attempt < 200; attempt += 1) {
if (await postedBody.exists()) { if (await postedBody.exists()) {
break; break;
} }

View File

@ -165,7 +165,7 @@ projects:
// When the long-running app starts and receives the forwarded webhook. // When the long-running app starts and receives the forwarded webhook.
final runFuture = app.run(); final runFuture = app.run();
for (var attempt = 0; attempt < 50; attempt += 1) { for (var attempt = 0; attempt < 200; attempt += 1) {
if (await postedBody.exists()) { if (await postedBody.exists()) {
break; break;
} }
@ -374,7 +374,7 @@ projects:
// When the long-running app starts and enough time passes for reconciliation polling. // When the long-running app starts and enough time passes for reconciliation polling.
final runFuture = app.run(); final runFuture = app.run();
for (var attempt = 0; attempt < 50; attempt += 1) { for (var attempt = 0; attempt < 200; attempt += 1) {
if (await postedBody.exists()) { if (await postedBody.exists()) {
break; break;
} }

View File

@ -103,7 +103,7 @@ projects:
// When the long-running app starts and receives the forwarded webhook. // When the long-running app starts and receives the forwarded webhook.
final runFuture = app.run(); final runFuture = app.run();
for (var attempt = 0; attempt < 50; attempt += 1) { for (var attempt = 0; attempt < 200; attempt += 1) {
if (await postedBody.exists()) { if (await postedBody.exists()) {
break; break;
} }
@ -208,7 +208,7 @@ projects:
// When the long-running app starts and webhook-forward emits that stderr line. // When the long-running app starts and webhook-forward emits that stderr line.
final runFuture = app.run(); final runFuture = app.run();
for (var attempt = 0; attempt < 50; attempt += 1) { for (var attempt = 0; attempt < 200; attempt += 1) {
if (records.any( if (records.any(
(record) => record.message.contains('error creating webhook'), (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. // When the long-running app starts and enough time passes for reconciliation polling.
final runFuture = app.run(); final runFuture = app.run();
for (var attempt = 0; attempt < 50; attempt += 1) { for (var attempt = 0; attempt < 200; attempt += 1) {
if (await postedBody.exists()) { if (await postedBody.exists()) {
break; break;
} }