| ... | @@ -1175,7 +1175,8 @@ describe("UsageService", () => { | ... | @@ -1175,7 +1175,8 @@ describe("UsageService", () => { |
| 1175 | return text; | 1175 | return text; |
| 1176 | }); | 1176 | }); |
| 1177 | | 1177 | |
| 1178 | const summary = yield* (yield* UsageService.make).readSummary(WINDOW); | 1178 | const restarted = yield* UsageService.make; |
| | 1179 | const summary = yield* restarted.readSummary(WINDOW); |
| 1179 | // The live rollout re-parses at the ultrafast rate (10 x 6); the | 1180 | // The live rollout re-parses at the ultrafast rate (10 x 6); the |
| 1180 | // deleted one keeps its saved v4 usage at the standard rate (20 x 1). | 1181 | // deleted one keeps its saved v4 usage at the standard rate (20 x 1). |
| 1181 | assert.strictEqual(totalOutputTokens(summary), 30); | 1182 | assert.strictEqual(totalOutputTokens(summary), 30); |
| ... | @@ -1188,6 +1189,9 @@ describe("UsageService", () => { | ... | @@ -1188,6 +1189,9 @@ describe("UsageService", () => { |
| 1188 | yield* Effect.promise(() => NodeFSP.readFile(legacyPath, "utf8")), | 1189 | yield* Effect.promise(() => NodeFSP.readFile(legacyPath, "utf8")), |
| 1189 | legacy, | 1190 | legacy, |
| 1190 | ); | 1191 | ); |
| | 1192 | // The migrated cache is written in the background; let it land before |
| | 1193 | // the layer removes the state directory under it. |
| | 1194 | yield* restarted.awaitPersisted; |
| 1191 | }).pipe( | 1195 | }).pipe( |
| 1192 | Effect.provide( | 1196 | Effect.provide( |
| 1193 | layerService({ | 1197 | layerService({ |