pg-interleave 0.4.0 → 0.5.0

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.
package/dist/index.d.ts CHANGED
@@ -32,6 +32,7 @@ export declare class PgInterleaveClient {
32
32
  getPid(client: Client): Promise<number>;
33
33
  intercept(options: InterceptOptions): Promise<BarrierHandle>;
34
34
  injectTornCommit(client: Client, times?: number): Promise<void>;
35
+ flushTrace(): Promise<void>;
35
36
  injectDeadlock(options: {
36
37
  client?: Client;
37
38
  clientPid?: number;
package/dist/index.js CHANGED
@@ -134,6 +134,14 @@ class PgInterleaveClient {
134
134
  throw new Error(`Failed to inject torn commit: HTTP ${res.status}`);
135
135
  }
136
136
  }
137
+ async flushTrace() {
138
+ const res = await fetch(`${this.controlUrl}/flush-trace`, {
139
+ method: "POST",
140
+ });
141
+ if (!res.ok) {
142
+ throw new Error(`Failed to flush trace: HTTP ${res.status}`);
143
+ }
144
+ }
137
145
  async injectDeadlock(options) {
138
146
  let pid = options.clientPid;
139
147
  if (!pid && options.client) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pg-interleave",
3
- "version": "0.4.0",
3
+ "version": "0.5.0",
4
4
  "description": "Deterministic PostgreSQL wire-protocol proxy client for concurrency and chaos testing",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",