test(core): avoid models cache recovery race (#33525)
This commit is contained in:
parent
e0c0411003
commit
a3825286cf
1 changed files with 2 additions and 5 deletions
|
|
@ -157,15 +157,12 @@ describe("ModelsDev Service", () => {
|
||||||
Effect.gen(function* () {
|
Effect.gen(function* () {
|
||||||
yield* writeCacheText("{")
|
yield* writeCacheText("{")
|
||||||
const state = yield* Ref.make({ ...initialState, body: JSON.stringify(fixture2) })
|
const state = yield* Ref.make({ ...initialState, body: JSON.stringify(fixture2) })
|
||||||
|
const context = yield* Layer.build(buildLayer(state))
|
||||||
const result = yield* Effect.acquireUseRelease(
|
const result = yield* Effect.acquireUseRelease(
|
||||||
Effect.sync(() => {
|
Effect.sync(() => {
|
||||||
Flag.OPENCODE_DISABLE_MODELS_FETCH = false
|
Flag.OPENCODE_DISABLE_MODELS_FETCH = false
|
||||||
}),
|
}),
|
||||||
() =>
|
() => ModelsDev.Service.use((s) => s.get()).pipe(Effect.provide(context)),
|
||||||
provided(
|
|
||||||
state,
|
|
||||||
ModelsDev.Service.use((s) => s.get()),
|
|
||||||
),
|
|
||||||
() =>
|
() =>
|
||||||
Effect.sync(() => {
|
Effect.sync(() => {
|
||||||
Flag.OPENCODE_DISABLE_MODELS_FETCH = true
|
Flag.OPENCODE_DISABLE_MODELS_FETCH = true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue