Skip to content

Commit b333cd1

Browse files
committed
test: add StoreStress harness and contention regression tests
1 parent 38ca30a commit b333cd1

5 files changed

Lines changed: 536 additions & 0 deletions

File tree

Scripts/StoreStress/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Package.resolved

Scripts/StoreStress/Package.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// swift-tools-version: 6.2
2+
import PackageDescription
3+
4+
let package = Package(
5+
name: "StoreStress",
6+
platforms: [
7+
.macOS(.v14),
8+
],
9+
dependencies: [
10+
.package(name: "CodexBar", path: "../.."),
11+
],
12+
targets: [
13+
.executableTarget(
14+
name: "StoreStress",
15+
dependencies: [
16+
.product(name: "CodexBarCore", package: "CodexBar"),
17+
],
18+
path: ".",
19+
exclude: ["Package.swift", "README.md"],
20+
swiftSettings: [
21+
.swiftLanguageMode(.v5),
22+
]),
23+
])

Scripts/StoreStress/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# StoreStress
2+
3+
Adversarial crash, contention, corpus-rebuild, WAL, and descriptor harness for the SQLite-backed
4+
`CostUsageStore`. It is a separate package so its internal test access never enters normal CodexBar builds.
5+
6+
Build the optimized harness from this directory:
7+
8+
```sh
9+
swift build -c release -Xswiftc -enable-testing
10+
```
11+
12+
Run `swift run -c release -Xswiftc -enable-testing StoreStress --` without arguments to print the available
13+
subcommands. Every store/cache argument should point at a disposable temporary directory. `rebuild` and
14+
`incremental` accept an optional sessions root, which makes it possible to measure a read-only corpus snapshot
15+
without writing to the real Codex session or CodexBar cache directories.

0 commit comments

Comments
 (0)