testing/proxied_bd_test_support library

Classes

BdStoreIdentity
The proxied server pair ONE fixture store is bound to.

Constants

requiredIsolatedBdInitFlags → const List<String>
The bd init flags an isolated fixture store cannot be built without.

Functions

censusPids(WorkspaceProcessCensus census) → Set<int>
Every PID census names, from either arm.
commandArgument(String command, String name) → String?
The value --name carries in command, however it was quoted.
describeWorkspaceProcessCensus(WorkspaceProcessCensus census) → String
census as a single line a failure can carry.
expectEmptyWorkspaceProcessCensus(WorkspaceProcessCensus census, {required String workspacePath, required String phase}) → void
Refuses unless census is empty on BOTH arms, naming phase when it is not.
isolatedBdFixtureSkipReason({required String? bdVersion, required Set<String> initFlags}) → String?
The skip reason when the installed bd cannot run an isolated fixture store, or null when it can.
parseLsofPids(String output, {required int selfPid}) → List<int>
The PIDs lsof's -F output names, minus selfPid.
processTable() → Future<Map<int, String>>
Every live process by PID, as ps reports it.
proxiedBdPidArtifact(String path) → ({int pid, int? port})?
The {pid, port} a bd proxy artifact at path records, or null when it is absent — a store that is already down.
proxiedStateStorePids({required String pidRootPath, String? readPidFile(String path) = readPidFileIfPresent}) → Set<int>
The store PIDs bd's own artifacts name under pidRootPath.
readPidFileIfPresent(String path) → String?
Reads a PID file that may not be there.
reserveProxiedBdPorts() → Future<ProxiedBdPorts>
Two loopback ports the OS has just confirmed free, and distinct.
stopAndAwaitProxiedStateStore({required String workspacePath, required String pidRootPath, Set<int> recordedPids = const {}}) → Future<void>
Stops the proxied store serving workspacePath and does not return until it is GONE.
storeProcessesIn(Map<int, String> table, String workspacePath) → List<({String command, int pid})>
The rows of table that are store processes running out of workspacePath.
verifyBdStoreIdentity({required String bdVersion, required String storePath, required String configPath, required String rootPath, required ProxiedBdPorts reserved}) → Future<BdStoreIdentity>
Reads bd's proxy artifacts and refuses unless they, and the live processes they name, all describe the store the caller just built.
waitForProxiedStateStoreExit({required Future<Set<int>> survivingPids(), required Future<Set<String>> heldLockPaths(), required DateTime now(), required Future<void> delay(Duration), Duration bound = const Duration(seconds: 10), Duration pollInterval = const Duration(milliseconds: 50)}) → Future<void>
Polls survivingPids and heldLockPaths until both come back empty.
workspaceProcessCensus(String workspacePath) → Future<WorkspaceProcessCensus>
WorkspaceProcessCensus against the live process table.
workspaceResidents(String workspacePath, {required int selfPid, required Future<ProcessResult> runProcess(String, List<String>)}) → Future<List<int>>
Every process still WORKING somewhere under workspacePath, by current directory.
workspaceStoreProcesses(String workspacePath) → Future<List<({String command, int pid})>>
Every STORE process still running out of workspacePath, live.

Typedefs

ProxiedBdPorts = ({int doltPort, int proxyPort})
The two loopback ports ONE fixture store's server pair listens on.
WorkspaceProcessCensus = ({List<int> residents, List<({String command, int pid})> stores})
One account of everything a harness can still find working under a workspace: the STORE processes named by their own --config/--root, and the PIDs whose working directory is inside it.