Skip to content

Commit 708b376

Browse files
committed
fix(test): corrigir race condition no teste de persistência do swarm
Teste 'save and load state from disk' agora aguarda _pendingSave antes de chamar _saveToDisk(), evitando escrita concorrente que corrompia JSON (SyntaxError: Unexpected end of JSON input no CI)
1 parent c6a80fe commit 708b376

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

tests/core/orchestration/swarm-intelligence.test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -950,7 +950,8 @@ describe('SwarmIntelligence', () => {
950950
content: 'works!',
951951
});
952952

953-
// Wait for async persistence
953+
// Wait for all pending async writes, then do a final save
954+
if (persisted._pendingSave) await persisted._pendingSave;
954955
await persisted._saveToDisk();
955956

956957
// Load into fresh instance

0 commit comments

Comments
 (0)