• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

datatug / datatug-core / 34394808506
100%

Build:
DEFAULT BRANCH: main
Ran 09 Sep 2026 07:24PM UTC
Jobs 1
Files 114
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Sep 2026 07:23PM UTC coverage: 92.178%. Remained the same
34394808506

push

github

web-flow
fix(schemer): remove the data race in scanTables' bulk fan-out (#315)

scanTables spawned 3 parallel.Run closures (scanColumnsInBulk,
scanConstraintsInBulk, scanIndexesInBulk) that all wrote directly to the
shared outer `err` variable while running concurrently - a data race
(WARNING: DATA RACE at scanner.go:45/51/57), reported by lane S86 while
fixing the analogous filestore bug in PR #314.

Fixed by giving each of the 3 closures its own named-return `err`, matching
the pattern PR #314 established: a fixed-size fan-out doesn't need a mutex,
only per-worker locals so nothing writes shared memory concurrently. No
mutex is warranted here because this fan-out is always exactly 3 workers,
never sized by input.

Audited every other parallel.Run call site in the module
(grep -rn "parallel.Run" --include='*.go' .) for the same pattern:
- pkg/schemer/scan_by_table.go (getTableProps, scanTableIndexes): each
  worker uses its own named/`:=` return and writes a distinct struct field
  or a distinct table/index pointer - safe, left untouched.
- pkg/comparator/compare_databases.go (compareSchemas, compareSchema): each
  worker writes a distinct slice index or a distinct struct field - safe,
  verified with a temporary 3-target/2-item probe under
  `go test -race -count=20` before removing it.
- pkg/storage/filestore/*.go (store_loader.go, store_project_saver.go,
  proj_dbdrivers_store.go, saver_filesystem.go's saveItems and its 6
  callers): each worker writes a distinct struct field or a distinct slice
  element - safe. loader_internals.go was already fixed by PR #314.

Extended scanner_full_test.go with TestScanCatalog_BulkFanOutRace: 2 tables
so all 3 bulk closures do real concurrent work. Verified (by stashing the
fix) that it reliably fails under `-race` on the pre-fix code, and passes
clean at `-race -count=20` after.

`go build ./... && go vet ./... && go test -race -count=1 ./...` is clean
for the whole module; `gofmt -l .` is empty; total coverage 93.8% (... (continued)

1 of 1 new or added line in 1 file covered. (100.0%)

4714 of 5114 relevant lines covered (92.18%)

0.92 hits per line

Jobs
ID Job ID Ran Files Coverage
1 34394808506.1 09 Sep 2026 07:24PM UTC 114
92.18
GitHub Action Run
Source Files on build 34394808506
  • Tree
  • List 114
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 0c76b2a7 on github
  • Prev Build on main (#34393684711)
  • Next Build on main (#34404178066)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc