@get-bb/plugin-sdk 0.4.18 → 0.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -6556,7 +6556,7 @@ function describeCalibrationEvents(events) {
|
|
|
6556
6556
|
|
|
6557
6557
|
// ../provider-bridge-protocol/src/testing/parity.ts
|
|
6558
6558
|
import { spawn } from "node:child_process";
|
|
6559
|
-
import { existsSync as existsSync2, mkdtempSync, rmSync, writeFileSync } from "node:fs";
|
|
6559
|
+
import { existsSync as existsSync2, mkdtempSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
6560
6560
|
import { tmpdir } from "node:os";
|
|
6561
6561
|
import { isAbsolute, join as join2, resolve as resolve2 } from "node:path";
|
|
6562
6562
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
@@ -6883,7 +6883,7 @@ async function replayRecording(options) {
|
|
|
6883
6883
|
const profile = options.profile ?? DEFAULT_REPLAY_PROFILE;
|
|
6884
6884
|
const recording = readBridgeRecording(options.recordingDir);
|
|
6885
6885
|
const stateDir = mkdtempSync(join2(tmpdir(), "bb-parity-replay-"));
|
|
6886
|
-
const workspaceDir = mkdtempSync(join2(tmpdir(), "bb-parity-ws-"));
|
|
6886
|
+
const workspaceDir = realpathSync(mkdtempSync(join2(tmpdir(), "bb-parity-ws-")));
|
|
6887
6887
|
const replayCommand = [
|
|
6888
6888
|
process.execPath,
|
|
6889
6889
|
REPLAY_CHILD_PATH,
|
|
@@ -6939,10 +6939,13 @@ async function replayRecording(options) {
|
|
|
6939
6939
|
const liveAssembler = options.createAssembler(providerId);
|
|
6940
6940
|
const planAssembler = (options.createPlanAssembler ?? options.createAssembler)(providerId);
|
|
6941
6941
|
const exactPlan = options.planFromCurrentLane === true;
|
|
6942
|
-
const
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6942
|
+
const planRecording = exactPlan ? withCurrentBridgeLane(recording) : recording;
|
|
6943
|
+
const steps = planRuntimeSteps(planRecording, planAssembler);
|
|
6944
|
+
const plannedEventCount = exactPlan ? assembleRecordedEvents(
|
|
6945
|
+
planRecording,
|
|
6946
|
+
options.createPlanAssembler ?? options.createAssembler,
|
|
6947
|
+
providerId
|
|
6948
|
+
).events.length : null;
|
|
6946
6949
|
const answeredIds = /* @__PURE__ */ new Set();
|
|
6947
6950
|
const pendingBridgeRequests = [];
|
|
6948
6951
|
const recordedAnswers = /* @__PURE__ */ new Map();
|
|
@@ -7103,7 +7106,14 @@ async function replayRecording(options) {
|
|
|
7103
7106
|
}
|
|
7104
7107
|
setCursor("end");
|
|
7105
7108
|
await waitFor("the last responses", () => sentRequestIds.every((id) => answeredIds.has(id)));
|
|
7106
|
-
|
|
7109
|
+
if (plannedEventCount !== null) {
|
|
7110
|
+
await waitFor(
|
|
7111
|
+
`all ${plannedEventCount} planned events before closing the bridge`,
|
|
7112
|
+
() => events.length >= plannedEventCount
|
|
7113
|
+
);
|
|
7114
|
+
} else {
|
|
7115
|
+
await waitFor("the stream to settle", () => Date.now() - lastOutputAt >= settleMs);
|
|
7116
|
+
}
|
|
7107
7117
|
child.stdin?.end();
|
|
7108
7118
|
const exitCode = await Promise.race([
|
|
7109
7119
|
exited,
|