test(dolt): add concurrent writer tests for embedded Dolt

Validates Gas Town multi-polecat concurrent access scenarios:
- Concurrent issue creation (10 goroutines)
- Same-issue update race conditions
- Read-write mix (5 readers, 5 writers, 100 iterations)
- Long transaction blocking
- Branch-per-agent merge race
- Worktree export isolation
- Concurrent dependency operations
- High contention stress test (20 workers, 1000 ops)

Also fixes Status() to scan string status from dolt_status table.

All tests pass with 100% success rate under contention.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
jasper
2026-01-17 01:54:34 -08:00
committed by gastown/crew/dennis
parent 2cbffca4f3
commit ab5f507c66
2 changed files with 760 additions and 4 deletions

View File

@@ -436,11 +436,11 @@ func (s *DoltStore) Status(ctx context.Context) (*DoltStatus, error) {
for rows.Next() {
var tableName string
var staged bool
var statusInt int
if err := rows.Scan(&tableName, &staged, &statusInt); err != nil {
var statusStr string
if err := rows.Scan(&tableName, &staged, &statusStr); err != nil {
return nil, fmt.Errorf("failed to scan status: %w", err)
}
entry := StatusEntry{Table: tableName, Status: statusInt}
entry := StatusEntry{Table: tableName, Status: statusStr}
if staged {
status.Staged = append(status.Staged, entry)
} else {
@@ -459,5 +459,5 @@ type DoltStatus struct {
// StatusEntry represents a changed table
type StatusEntry struct {
Table string
Status int // 1=new, 2=modified, 3=deleted
Status string // "new", "modified", "deleted"
}