Skip to content

Commit c91813f

Browse files
committed
fix merge conflict issues
1 parent a65eaff commit c91813f

6 files changed

Lines changed: 18 additions & 66 deletions

File tree

fixtures/vitest-pool-workers-examples/durable-objects/wrangler.jsonc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,7 @@
2121
"new_sqlite_classes": ["SQLiteDurableObject"],
2222
},
2323
],
24+
"exports": {
25+
""
26+
}
2427
}

packages/miniflare/src/plugins/core/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ export function getGlobalServices({
11791179
// tail above.
11801180
if (sharedOptions.unsafeObservability) {
11811181
services.push(
1182-
...getObservabilityServices(tmpPath, sharedOptions.defaultPersistRoot)
1182+
...getObservabilityServices(tmpPath, sharedOptions.resourcePersistencePath)
11831183
);
11841184
}
11851185

packages/miniflare/src/plugins/core/observability.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const OBSERVABILITY_STORAGE_SERVICE_NAME = "obs:storage";
2424

2525
export function getObservabilityServices(
2626
tmpPath: string,
27-
defaultPersistRoot: string | undefined
27+
resourcePersistencePath: string | undefined
2828
): Service[] {
2929
// The TraceStore DO is SQLite-backed, so it needs disk-backed storage (the
3030
// in-memory option doesn't support SQL). Persist under `.wrangler/state` when
@@ -33,8 +33,7 @@ export function getObservabilityServices(
3333
const storagePath = getPersistPath(
3434
"observability",
3535
tmpPath,
36-
defaultPersistRoot,
37-
undefined
36+
resourcePersistencePath
3837
);
3938
mkdirSync(storagePath, { recursive: true });
4039

packages/miniflare/test/index.spec.ts

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2927,61 +2927,6 @@ test("Miniflare: workerd crash in handler => restart", async ({ expect }) => {
29272927
expect(await r4.text()).toBe("ok 2");
29282928
});
29292929

2930-
test("Miniflare: logs workerd restart failures", async ({ expect }) => {
2931-
const log = new TestLog();
2932-
const logError = vi.spyOn(log, "error").mockImplementation(() => {});
2933-
const handleRuntimeRestart = vi.fn();
2934-
let runtimeStarts = 0;
2935-
const options = {
2936-
log,
2937-
modules: true,
2938-
handleRuntimeStdio() {
2939-
runtimeStarts++;
2940-
if (runtimeStarts === 2) {
2941-
throw new Error("restart failed");
2942-
}
2943-
},
2944-
unsafeHandleRuntimeRestart: handleRuntimeRestart,
2945-
script: `
2946-
import { abortIsolate } from "cloudflare:workers";
2947-
export default {
2948-
fetch(request) {
2949-
if (new URL(request.url).searchParams.get("crash")) {
2950-
abortIsolate("test crash");
2951-
}
2952-
return new Response("ok");
2953-
},
2954-
}
2955-
`,
2956-
} satisfies MiniflareOptions;
2957-
const mf = new Miniflare(options);
2958-
useDispose(mf);
2959-
2960-
await mf.ready;
2961-
await expect(
2962-
mf.dispatchFetch("http://placeholder/?crash=1")
2963-
).rejects.toThrow();
2964-
2965-
await vi.waitFor(() => {
2966-
expect(logError).toHaveBeenCalledWith(
2967-
expect.objectContaining({
2968-
code: "ERR_RUNTIME_FAILURE",
2969-
message:
2970-
"The Workers runtime failed to restart after an unexpected crash.",
2971-
})
2972-
);
2973-
});
2974-
expect(handleRuntimeRestart).not.toHaveBeenCalled();
2975-
await expect(mf.ready).rejects.toMatchObject({
2976-
code: "ERR_RUNTIME_FAILURE",
2977-
message: "The Workers runtime failed to restart after an unexpected crash.",
2978-
});
2979-
2980-
await mf.setOptions(options);
2981-
const response = await mf.dispatchFetch("http://placeholder/");
2982-
expect(await response.text()).toBe("ok");
2983-
});
2984-
29852930
test("Miniflare: logs post-restart callback failures", async ({ expect }) => {
29862931
const log = new TestLog();
29872932
const logError = vi.spyOn(log, "error").mockImplementation(() => {});

packages/miniflare/test/plugins/images/transform.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ describe("Images binding local transforms", () => {
6363
modules: true,
6464
script: WORKER_SCRIPT,
6565
images: { binding: "IMAGES" },
66-
imagesPersist: false,
6766
} satisfies MiniflareOptions);
6867
});
6968

pnpm-lock.yaml

Lines changed: 12 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)