ci(bazel): halve the embedded cmd tier's cost (seeded bd init schema, no race exit sleep, concurrency-aware packing) (#7437)

//cmd/bd:bd_embedded_test sits at Bazel's 50-shard cap and was the embedded
lane's floor (shards 62-250s). Measured on rbe-west, every shard's wall time
was its single slowest top-level test, and most of a test's time was `bd
init` (~20s under -race: one Dolt commit per schema migration) plus a fixed
1s per bd subprocess exit (the race runtime's atexit_sleep_ms).

- bdInit seeds .beads/embeddeddolt/<db> from a per-process schema template
  (an empty database with every migration applied, made once per shard by a
  non-race build of internal/storage/embeddeddolt/cmd) before running the
  real `bd init`, which then skips the migration chain and does everything
  else itself (identity, prefix, config, hooks, agent files, git commit).
  Only for argument lists it understands (--prefix/--database plus
  --quiet/--skip-hooks/--skip-agents/--non-interactive), and it checks the
  result is the seeded embedded database. BEADS_TEST_FRESH_INIT=1 turns it
  off. The TestEmbeddedInit* tests run their own init and are unaffected.
- GORACE=atexit_sleep_ms=0 on the target: the bd subprocesses no longer
  sleep 1s before exiting. A race they hit while running still fails the
  command as before.
- TestEmbeddedInitSelectedExcludeRouting (serial, t.Setenv, 7 full inits,
  ~113s) is split into ...Stealth and ...Fork top-level functions; same
  cases, same assertions.
- The generator packs with a model of the shard process (pack_concurrent):
  tests without a top-level t.Parallel run one after another, the rest
  share -test.parallel=4. The durations are re-measured on rbe-west.

rbe-west, `bazel test //cmd/bd:bd_embedded_test --config=embedded
--nocache_test_results`: test-seconds 20.2k -> ~10.3k, shard-seconds
8.0k -> ~4.2k, slowest shard 243s -> 138s / 163s (two runs, before the
repack).

Bead: ga-vnycm2.17

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Julian Knutsen 2026-10-09 19:20:33 +00:00 • committed by GitHub
commit 1531a31760
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 978 additions and 615 deletions

View file

@ -188,9 +188,11 @@
#
# 50-shard split for the Bazel-only embedded-Dolt cmd tier
# (bazel-embedded in .github/workflows/bazel.yml), bin-packed
# longest-processing-time-first by measured wall-time from
# longest-first by measured wall-time from
# scripts/ci/embedded_cmd_test_durations.json (see that file for provenance
# and its "relative weight, not absolute SLA" caveat).
# and its "relative weight, not absolute SLA" caveat) onto the shard
# whose estimated wall time grows least: serial tests (no top-level
# t.Parallel) add up, parallel ones share -test.parallel=4.
# Regenerate with scripts/ci/gen_embedded_cmd_shard_manifest.py 50
# --weights=duration --write after adding, splitting or removing
# TestEmbedded* functions in cmd/bd/*_embedded_test.go. --write is
@ -206,301 +208,302 @@
# This file is generated: notes added here are erased by the next
# regeneration. Add them to the generator or the durations file instead.
50 1 TestEmbeddedCommentsCLI
50 1 TestEmbeddedDepAddWispSource
50 1 TestEmbeddedListFiltering
50 1 TestEmbeddedPrimeChangeDirDefaultTemplateMatchesTarget
50 1 TestEmbeddedInitA
50 2 TestEmbeddedCreateRepoFromNonBeadsCwd
50 2 TestEmbeddedDeleteJSONDependencyErrorContract
50 2 TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate
50 2 TestEmbeddedHistoryConcurrent
50 2 TestEmbeddedInitA
50 2 TestEmbeddedGateCreate
50 3 TestEmbeddedAdminCompactTier2Honesty
50 3 TestEmbeddedMaxRowsListLimitInteraction
50 3 TestEmbeddedOrphans
50 3 TestEmbeddedShowUnresolvableDeps
50 3 TestEmbeddedStale
50 3 TestEmbeddedRoutedMutatingSiblingAssignTagDep
50 4 TestEmbeddedBootstrapConcurrent
50 4 TestEmbeddedDuplicatesConcurrent
50 4 TestEmbeddedInfo
50 4 TestEmbeddedMaxRowsDoctorAndConfig
50 4 TestEmbeddedRoutedSiblingWritesCommitTargetHead
50 4 TestEmbeddedUpdateConcurrent
50 5 TestEmbeddedCreateScalarAndRelationships
50 5 TestEmbeddedDefer
50 5 TestEmbeddedDoltBlockedAndCommit
50 5 TestEmbeddedGCConcurrent
50 5 TestEmbeddedPromote
50 5 TestEmbeddedMaxRowsListLimitInteraction
50 6 TestEmbeddedCreateStorageClassConflicts
50 6 TestEmbeddedGC
50 6 TestEmbeddedGetDependencies
50 6 TestEmbeddedQuickConcurrent
50 6 TestEmbeddedSwarm
50 7 TestEmbeddedCreateCrossRepoDryRunWithParent
50 7 TestEmbeddedEpicStatus
50 7 TestEmbeddedGate
50 7 TestEmbeddedWhere
50 7 TestEmbeddedDepA
50 8 TestEmbeddedChangeDirOverridesInheritedBeadsDir
50 8 TestEmbeddedMemoryConcurrent
50 8 TestEmbeddedUpdateConcurrent
50 8 TestEmbeddedVCConcurrent
50 8 TestEmbeddedDepB
50 9 TestEmbeddedCloseAlreadyClosed
50 9 TestEmbeddedConfigConcurrent
50 9 TestEmbeddedExternalCapabilityReadyAfterShip
50 9 TestEmbeddedPrimeConcurrent
50 9 TestEmbeddedKVConcurrent
50 10 TestEmbeddedDepB
50 10 TestEmbeddedHuman
50 10 TestEmbeddedInitExplicitBeadsDirIsAuthoritative
50 10 TestEmbeddedPromoteCLI
50 10 TestEmbeddedListFiltering
50 11 TestEmbeddedBlockedConcurrent
50 11 TestEmbeddedDepA
50 11 TestEmbeddedMaxRowsDepTreeAndDuplicates
50 11 TestEmbeddedState
50 11 TestEmbeddedInitRoleRouting
50 12 TestEmbeddedDirectCommitPathsBatchAutoCommitDoesNotAdvanceHead
50 12 TestEmbeddedPrimeChangeDirPrimesTarget
50 12 TestEmbeddedPromoteCLIConcurrent
50 12 TestEmbeddedSearchConcurrent
50 12 TestEmbeddedTypes
50 12 TestEmbeddedContributorCreate
50 13 TestEmbeddedAutoImportJSONLNoExplicitCommit
50 13 TestEmbeddedDiff
50 13 TestEmbeddedDuplicates
50 13 TestEmbeddedShipConcurrent
50 13 TestEmbeddedInitGitBootstrapRouting
50 14 TestEmbeddedInitConcurrent
50 14 TestEmbeddedOrphansConcurrent
50 14 TestEmbeddedPrimeChangeDirRedirectNoticeFollowsTarget
50 14 TestEmbeddedRoutedMutatingSiblingDeleteClose
50 14 TestEmbeddedSwarm
50 14 TestEmbeddedCloseConcurrent
50 15 TestEmbeddedChildrenConcurrent
50 15 TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout
50 15 TestEmbeddedCreateDryRunCrossRepoDoesNotMigrateTarget
50 15 TestEmbeddedEpicCloseEligibleReasonFlag
50 15 TestEmbeddedExplicitHierarchicalParentEdges
50 15 TestEmbeddedIfRevisionReopenGuardDirect
50 15 TestEmbeddedVersionConcurrent
50 15 TestEmbeddedCloseAlreadyClosed
50 16 TestEmbeddedBlockedLabelFilters
50 16 TestEmbeddedGCConditionalMatcherDecode
50 16 TestEmbeddedGateInheritsDownParentChain
50 16 TestEmbeddedGatedRendering
50 16 TestEmbeddedKV
50 16 TestEmbeddedMaxRowsReady
50 16 TestEmbeddedMemoryCorpusBudget
50 16 TestEmbeddedOpen_EmptyDatabaseRejected
50 16 TestEmbeddedRestoreConcurrent
50 16 TestEmbeddedVCCommitVariantsAndMerge
50 16 TestEmbeddedVersion
50 16 TestEmbeddedRoutedSiblingWritesCommitTargetHead
50 17 TestEmbeddedCloseGuardsAndEpics
50 17 TestEmbeddedCompact
50 17 TestEmbeddedGateConcurrent
50 17 TestEmbeddedListComments
50 17 TestEmbeddedReadOnlyCommandsSpawnNoGit
50 17 TestEmbeddedConfigConcurrent
50 18 TestEmbeddedContext
50 18 TestEmbeddedContributorCreate
50 18 TestEmbeddedImportClosedChildWhoseParentWasDeleted
50 18 TestEmbeddedReopen
50 18 TestEmbeddedStateConcurrent
50 18 TestEmbeddedGate
50 19 TestEmbeddedAdminBlocked
50 19 TestEmbeddedCreateRepoRelativeExistingWorkspaceUnaffected
50 19 TestEmbeddedDoltConcurrent
50 19 TestEmbeddedMaxRowsListBasic
50 19 TestEmbeddedPruneSafetyAndScope
50 19 TestEmbeddedShowDetailAndCurrent
50 20 TestEmbeddedCreateStorageClassBatchAndMisc
50 20 TestEmbeddedDepListSingleIDWarnsOnDroppedExternalEdge
50 20 TestEmbeddedKVConcurrent
50 20 TestEmbeddedSetup
50 20 TestEmbeddedDelete
50 21 TestEmbeddedBackup
50 21 TestEmbeddedCreateCrossRepoUninit
50 21 TestEmbeddedDiffConcurrent
50 21 TestEmbeddedQuick
50 21 TestEmbeddedQuickstart
50 21 TestEmbeddedBootstrap
50 22 TestEmbeddedAdminCompactReadOnlyAllowed
50 22 TestEmbeddedCreateRepoProxiedTargetError
50 22 TestEmbeddedDuplicateConcurrent
50 22 TestEmbeddedFlatten
50 22 TestEmbeddedTypesAgreeWithCreate
50 22 TestEmbeddedUnclaim
50 23 TestEmbeddedExportConcurrent
50 23 TestEmbeddedHistory
50 23 TestEmbeddedMaxRowsGraph
50 23 TestEmbeddedSetupConcurrent
50 23 TestEmbeddedShip
50 23 TestEmbeddedBootstrapConcurrent
50 23 TestEmbeddedHooksConcurrent
50 23 TestEmbeddedShowConcurrent
50 24 TestEmbeddedCloseBasic
50 24 TestEmbeddedImportUpsertAndPrefixSync
50 24 TestEmbeddedQuery
50 24 TestEmbeddedReclaimRunsTheLeaseReclaimerRole
50 24 TestEmbeddedUpdateRoutedStoreCommitsTargetHead
50 24 TestEmbeddedAutoImportFallback_ConflictSkip_EmptyDBImportsAll
50 24 TestEmbeddedBackupConcurrent
50 24 TestEmbeddedBlocked
50 24 TestEmbeddedComments
50 24 TestEmbeddedCompactMisdatedChild
50 24 TestEmbeddedContextConcurrent
50 24 TestEmbeddedCreateCommitPending
50 24 TestEmbeddedCreateRepoFromNonBeadsCwd
50 24 TestEmbeddedCreateStorageClassBasic
50 24 TestEmbeddedCreateWithGitRemote
50 24 TestEmbeddedFindDuplicatesConcurrent
50 24 TestEmbeddedHistoryConcurrent
50 24 TestEmbeddedHooks
50 24 TestEmbeddedHumanConcurrent
50 24 TestEmbeddedInfoSuppressGitHooks
50 24 TestEmbeddedMigrateConcurrent
50 24 TestEmbeddedOnboard
50 24 TestEmbeddedPromote
50 24 TestEmbeddedQuickstart
50 24 TestEmbeddedWhere
50 25 TestEmbeddedBackupConcurrent
50 25 TestEmbeddedCreateStorageClassBasic
50 25 TestEmbeddedFindDuplicatesConcurrent
50 25 TestEmbeddedInitGitBootstrapRouting
50 25 TestEmbeddedInitHooksRouting
50 25 TestEmbeddedAdminCompactReadOnlyAllowed
50 25 TestEmbeddedAutoImportFallback_ConflictSkip_DoesNotClobber
50 25 TestEmbeddedConfigNoWorkspaceStoreFreeCommands
50 25 TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout
50 25 TestEmbeddedCreateGraphAndBulk
50 25 TestEmbeddedDoltRemoteAndPush
50 25 TestEmbeddedGateInheritsDownParentChain
50 25 TestEmbeddedListConcurrent
50 25 TestEmbeddedOnboardConcurrent
50 25 TestEmbeddedPrime
50 25 TestEmbeddedQuickstartConcurrent
50 25 TestEmbeddedRenamePrefixConcurrent
50 25 TestEmbeddedSetup
50 25 TestEmbeddedSetupConcurrent
50 25 TestEmbeddedUpdateBatchAutoCommitDoesNotAdvanceHead
50 25 TestEmbeddedUpdateFields
50 25 TestEmbeddedVCCommitVariantsAndMerge
50 25 TestEmbeddedVersion
50 25 TestEmbeddedVersionConcurrent
50 26 TestEmbeddedCreateCommitPending
50 26 TestEmbeddedInitC
50 26 TestEmbeddedRenamePrefixBasic
50 26 TestEmbeddedRoutedMutatingSiblingAssignTagDep
50 26 TestEmbeddedSupersedeConcurrent
50 26 TestEmbeddedAdminBlocked
50 26 TestEmbeddedBlockedLabelFilters
50 26 TestEmbeddedClaimPools
50 26 TestEmbeddedCompactConcurrent
50 26 TestEmbeddedExportConcurrent
50 26 TestEmbeddedGCConcurrent
50 26 TestEmbeddedGraphConcurrent
50 26 TestEmbeddedPrimeChangeDirPrimesTarget
50 26 TestEmbeddedPrimeConcurrent
50 26 TestEmbeddedReopenConcurrent
50 26 TestEmbeddedTodoConcurrent
50 26 TestEmbeddedTypes
50 26 TestEmbeddedTypesConcurrent
50 27 TestEmbeddedComments
50 27 TestEmbeddedMaxRowsReadyMerge
50 27 TestEmbeddedPrime
50 27 TestEmbeddedPruneDryRunAndFilters
50 27 TestEmbeddedReopenConcurrent
50 27 TestEmbeddedBranch
50 27 TestEmbeddedContext
50 27 TestEmbeddedCountIncludeEphemeral
50 27 TestEmbeddedCreateFormCommitsLabelOnlyCreate
50 27 TestEmbeddedFederationConcurrent
50 27 TestEmbeddedGateListScoped
50 27 TestEmbeddedIfRevisionReopenGuardDirect
50 27 TestEmbeddedOrphans
50 27 TestEmbeddedPurgeWispsPlaneRetention
50 27 TestEmbeddedReclaimRunsTheLeaseReclaimerRole
50 27 TestEmbeddedStaleLabelFilters
50 28 TestEmbeddedConfigNoWorkspaceStoreFreeCommands
50 28 TestEmbeddedEpicCloseEligibleReasonOutput
50 28 TestEmbeddedMigrate
50 28 TestEmbeddedAutoImportJSONLConcurrentWriter
50 28 TestEmbeddedAutoImportJSONLSkipsNonEmpty
50 28 TestEmbeddedBranchConcurrent
50 28 TestEmbeddedCreateConcurrent
50 28 TestEmbeddedEpicCloseEligibleReasonFlag
50 28 TestEmbeddedFederationStatus
50 28 TestEmbeddedLabelAddRemove
50 28 TestEmbeddedPurgeConcurrent
50 28 TestEmbeddedReadyClaimConcurrent
50 28 TestEmbeddedStatus
50 28 TestEmbeddedSwarmConcurrent
50 29 TestEmbeddedClaimPools
50 29 TestEmbeddedCreateGraphAndBulk
50 29 TestEmbeddedCreateJSONEchoesSubSecondTimestamps
50 29 TestEmbeddedHumanConcurrent
50 29 TestEmbeddedInitSelectedExcludeRouting
50 29 TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate
50 29 TestEmbeddedDepConcurrent
50 29 TestEmbeddedFlatten
50 29 TestEmbeddedGetDependencies
50 29 TestEmbeddedImportUpsertAndPrefixSync
50 29 TestEmbeddedInfo
50 29 TestEmbeddedMaxRowsDoctorAndConfig
50 29 TestEmbeddedOrphansConcurrent
50 29 TestEmbeddedRenamePrefixEdgeCases
50 30 TestEmbeddedAutoImportFallback_ConflictSkip_EmptyDBImportsAll
50 30 TestEmbeddedDepConcurrent
50 30 TestEmbeddedExportFormats
50 30 TestEmbeddedReadyClaimConcurrent
50 30 TestEmbeddedStaleConcurrent
50 30 TestEmbeddedAutoImportJSONLNoExplicitCommit
50 30 TestEmbeddedCreateJSONEchoesSubSecondTimestamps
50 30 TestEmbeddedDepAddWispSource
50 30 TestEmbeddedExportFlags
50 30 TestEmbeddedListComments
50 30 TestEmbeddedPurgeBasics
50 30 TestEmbeddedReadOnlyCommandsSpawnNoGit
50 30 TestEmbeddedReadyConcurrent
50 30 TestEmbeddedRoutedMutatingSiblingDeleteClose
50 31 TestEmbeddedAutoImportFallback_ConflictSkip_DoesNotClobber
50 31 TestEmbeddedAutoImportJSONLConcurrentWriter
50 31 TestEmbeddedDeferAutoWake
50 31 TestEmbeddedExternalMutationPolicy
50 31 TestEmbeddedShowConcurrent
50 31 TestEmbeddedCreateCrossRepoUninit
50 31 TestEmbeddedCreateDryRunRepoDoesNotInitializeTarget
50 31 TestEmbeddedDoltBlockedAndCommit
50 31 TestEmbeddedDoltConcurrent
50 31 TestEmbeddedGatedRendering
50 31 TestEmbeddedImportFromSources
50 31 TestEmbeddedInfoConcurrent
50 31 TestEmbeddedInitB
50 31 TestEmbeddedMigrate
50 32 TestEmbeddedCreateCrossRepo
50 32 TestEmbeddedDuplicate
50 32 TestEmbeddedInitArtifactRouting
50 32 TestEmbeddedShowBasicsAndJSON
50 32 TestEmbeddedUpdateLifecycle
50 32 TestEmbeddedBackup
50 32 TestEmbeddedExternalCapabilityReadyAfterShip
50 32 TestEmbeddedFederationPeers
50 32 TestEmbeddedLabelConcurrent
50 32 TestEmbeddedMaxRowsReadyMerge
50 32 TestEmbeddedPreviewDoesNotConsumeVersionMarker
50 32 TestEmbeddedRestore
50 32 TestEmbeddedTypesAgreeWithCreate
50 33 TestEmbeddedCreateConcurrent
50 33 TestEmbeddedCreateRepoRelativeUninitRefused
50 33 TestEmbeddedEpicCloseEligible
50 33 TestEmbeddedSearch
50 33 TestEmbeddedTodo
50 33 TestEmbeddedBlockedConcurrent
50 33 TestEmbeddedDefer
50 33 TestEmbeddedGC
50 33 TestEmbeddedPruneDryRunAndFilters
50 33 TestEmbeddedPurgeFiltered
50 33 TestEmbeddedQuery
50 33 TestEmbeddedVCConcurrent
50 33 TestEmbeddedWhereConcurrent
50 34 TestEmbeddedCreateDryRunRepoDoesNotInitializeTarget
50 34 TestEmbeddedGateListScoped
50 34 TestEmbeddedLintConcurrent
50 34 TestEmbeddedPurgeWispsPlaneRetention
50 34 TestEmbeddedReady
50 34 TestEmbeddedCompact
50 34 TestEmbeddedCreateCrossRepoWithParent
50 34 TestEmbeddedCreateRepoRelativeUninitRefused
50 34 TestEmbeddedCreateStorageClassConflicts
50 34 TestEmbeddedDuplicatesConcurrent
50 34 TestEmbeddedEpicCloseEligibleReasonOutput
50 34 TestEmbeddedFlattenConcurrent
50 34 TestEmbeddedOpen_EmptyDatabaseRejected
50 34 TestEmbeddedRestoreConcurrent
50 34 TestEmbeddedUpdateLifecycle
50 35 TestEmbeddedCommentsCLIConcurrent
50 35 TestEmbeddedHooksConcurrent
50 35 TestEmbeddedLabelPropagateRename
50 35 TestEmbeddedListSearchAndOutput
50 35 TestEmbeddedSupersede
50 35 TestEmbeddedCreateCrossRepo
50 35 TestEmbeddedDeleteJSONDependencyErrorContract
50 35 TestEmbeddedDuplicateConcurrent
50 35 TestEmbeddedInitArtifactRouting
50 35 TestEmbeddedMaxRowsListBasic
50 35 TestEmbeddedStateConcurrent
50 35 TestEmbeddedVCStatusAndCommit
50 36 TestEmbeddedDeferConcurrent
50 36 TestEmbeddedFederationPeers
50 36 TestEmbeddedFlattenConcurrent
50 36 TestEmbeddedStatusConcurrent
50 36 TestEmbeddedTodoConcurrent
50 36 TestEmbeddedAdminCompactTier2Honesty
50 36 TestEmbeddedCloseBasic
50 36 TestEmbeddedConfig
50 36 TestEmbeddedCountConcurrent
50 36 TestEmbeddedDirectCommitPathsBatchAutoCommitDoesNotAdvanceHead
50 36 TestEmbeddedInitConcurrent
50 36 TestEmbeddedLintConcurrent
50 36 TestEmbeddedPrimeChangeDirRedirectNoticeFollowsTarget
50 37 TestEmbeddedInfoSuppressGitHooks
50 37 TestEmbeddedInitB
50 37 TestEmbeddedChangeDirOverridesInheritedBeadsDir
50 37 TestEmbeddedChildren
50 37 TestEmbeddedChildrenConcurrent
50 37 TestEmbeddedCreateCrossRepoDryRunWithParent
50 37 TestEmbeddedCreateStorageClassBatchAndMisc
50 37 TestEmbeddedQueryConcurrent
50 37 TestEmbeddedUndeferConcurrent
50 37 TestEmbeddedUpdateBatchAutoCommitDoesNotAdvanceHead
50 37 TestEmbeddedStaleConcurrent
50 38 TestEmbeddedBlocked
50 38 TestEmbeddedCreateCrossRepoWithParent
50 38 TestEmbeddedEpicConcurrent
50 38 TestEmbeddedHooks
50 38 TestEmbeddedUndefer
50 38 TestEmbeddedCreateDryRunDoesNotMigrate
50 38 TestEmbeddedImportPromotedWispRoundtrip
50 38 TestEmbeddedMaxRowsReady
50 38 TestEmbeddedReady
50 38 TestEmbeddedRenamePrefixBasic
50 38 TestEmbeddedShip
50 38 TestEmbeddedSupersede
50 39 TestEmbeddedBranchConcurrent
50 39 TestEmbeddedCountIncludeInfra
50 39 TestEmbeddedCreateWithGitRemote
50 39 TestEmbeddedDelete
50 39 TestEmbeddedUpdateFields
50 39 TestEmbeddedDeferAutoWake
50 39 TestEmbeddedEpicConcurrent
50 39 TestEmbeddedGateConcurrent
50 39 TestEmbeddedInitC
50 39 TestEmbeddedKV
50 39 TestEmbeddedLint
50 39 TestEmbeddedPromoteCLI
50 40 TestEmbeddedCountConcurrent
50 40 TestEmbeddedCountIncludeEphemeral
50 40 TestEmbeddedCreateFormCommitsLabelOnlyCreate
50 40 TestEmbeddedLabelEditReports
50 40 TestEmbeddedPreviewDoesNotConsumeVersionMarker
50 40 TestEmbeddedCommentsCLI
50 40 TestEmbeddedCommentsCLIConcurrent
50 40 TestEmbeddedDepAndLinkBatchAutoCommitDoesNotAdvanceHead
50 40 TestEmbeddedDiffConcurrent
50 40 TestEmbeddedImportConcurrent
50 40 TestEmbeddedSupersedeConcurrent
50 40 TestEmbeddedTodo
50 41 TestEmbeddedGateCreate
50 41 TestEmbeddedLabelAddRemove
50 41 TestEmbeddedLabelConcurrent
50 41 TestEmbeddedListConcurrent
50 41 TestEmbeddedTypesConcurrent
50 41 TestEmbeddedHistory
50 41 TestEmbeddedInitSelectedExcludeRoutingFork
50 41 TestEmbeddedListSearchAndOutput
50 41 TestEmbeddedPromoteCLIConcurrent
50 41 TestEmbeddedQuick
50 41 TestEmbeddedUndefer
50 42 TestEmbeddedImportFromSources
50 42 TestEmbeddedReadyConcurrent
50 42 TestEmbeddedRenamePrefixEdgeCases
50 42 TestEmbeddedRestore
50 42 TestEmbeddedSquashWispMoleculeClearsRootEphemeral
50 42 TestEmbeddedCountIncludeInfra
50 42 TestEmbeddedDuplicate
50 42 TestEmbeddedEpicCloseEligible
50 42 TestEmbeddedInitExplicitBeadsDirIsAuthoritative
50 42 TestEmbeddedQuietFlagSuppressesSuccessOutput
50 42 TestEmbeddedStatusConcurrent
50 43 TestEmbeddedFindDuplicates
50 43 TestEmbeddedGraph
50 43 TestEmbeddedImportPromotedWispRoundtrip
50 43 TestEmbeddedInfoConcurrent
50 43 TestEmbeddedQuickstartConcurrent
50 43 TestEmbeddedCreateRepoRelativeExistingWorkspaceUnaffected
50 43 TestEmbeddedImportClosedChildWhoseParentWasDeleted
50 43 TestEmbeddedLabelEditReports
50 43 TestEmbeddedShowBasicsAndJSON
50 43 TestEmbeddedState
50 43 TestEmbeddedSwarmConcurrent
50 44 TestEmbeddedDoltRemoteAndPush
50 44 TestEmbeddedGraphConcurrent
50 44 TestEmbeddedImportConcurrent
50 44 TestEmbeddedInitRoleRouting
50 44 TestEmbeddedWhereConcurrent
50 44 TestEmbeddedFindDuplicates
50 44 TestEmbeddedMaxRowsGraph
50 44 TestEmbeddedMemory
50 44 TestEmbeddedShipConcurrent
50 44 TestEmbeddedShowUnresolvableDeps
50 44 TestEmbeddedSquashWispMoleculeClearsRootEphemeral
50 45 TestEmbeddedChildren
50 45 TestEmbeddedCompactConcurrent
50 45 TestEmbeddedMigrateConcurrent
50 45 TestEmbeddedShowDetailAndCurrent
50 45 TestEmbeddedVCStatusAndCommit
50 45 TestEmbeddedCloseGuardsAndEpics
50 45 TestEmbeddedCreateRepoProxiedTargetError
50 45 TestEmbeddedCreateScalarAndRelationships
50 45 TestEmbeddedDuplicates
50 45 TestEmbeddedUndeferConcurrent
50 45 TestEmbeddedUpdateRoutedStoreCommitsTargetHead
50 46 TestEmbeddedCompactMisdatedChild
50 46 TestEmbeddedCount
50 46 TestEmbeddedCreateDryRunDoesNotMigrate
50 46 TestEmbeddedFederationStatus
50 46 TestEmbeddedStaleLabelFilters
50 46 TestEmbeddedDepListSingleIDWarnsOnDroppedExternalEdge
50 46 TestEmbeddedDepNoCycleCheck
50 46 TestEmbeddedEpicStatus
50 46 TestEmbeddedInitHooksRouting
50 46 TestEmbeddedReopen
50 47 TestEmbeddedBootstrap
50 47 TestEmbeddedBranch
50 47 TestEmbeddedContextConcurrent
50 47 TestEmbeddedLint
50 47 TestEmbeddedPurgeConcurrent
50 47 TestEmbeddedDiff
50 47 TestEmbeddedGraph
50 47 TestEmbeddedHuman
50 47 TestEmbeddedMemoryCorpusBudget
50 47 TestEmbeddedPrimeChangeDirDefaultTemplateMatchesTarget
50 47 TestEmbeddedQuickConcurrent
50 47 TestEmbeddedSearchConcurrent
50 48 TestEmbeddedCloseConcurrent
50 48 TestEmbeddedConfig
50 48 TestEmbeddedDepAndLinkBatchAutoCommitDoesNotAdvanceHead
50 48 TestEmbeddedOnboardConcurrent
50 48 TestEmbeddedQuietFlagSuppressesSuccessOutput
50 48 TestEmbeddedCreateDryRunCrossRepoDoesNotMigrateTarget
50 48 TestEmbeddedExportFormats
50 48 TestEmbeddedLabelPropagateRename
50 48 TestEmbeddedMaxRowsDepTreeAndDuplicates
50 48 TestEmbeddedMemoryConcurrent
50 48 TestEmbeddedSearch
50 49 TestEmbeddedDepNoCycleCheck
50 49 TestEmbeddedFederationConcurrent
50 49 TestEmbeddedMemory
50 49 TestEmbeddedOnboard
50 49 TestEmbeddedPurgeFiltered
50 49 TestEmbeddedExplicitHierarchicalParentEdges
50 49 TestEmbeddedInitSelectedExcludeRoutingStealth
50 50 TestEmbeddedAutoImportJSONLSkipsNonEmpty
50 50 TestEmbeddedExportFlags
50 50 TestEmbeddedPurgeBasics
50 50 TestEmbeddedRenamePrefixConcurrent
50 50 TestEmbeddedUnclaim
50 50 TestEmbeddedDeferConcurrent
50 50 TestEmbeddedExternalMutationPolicy
50 50 TestEmbeddedGCConditionalMatcherDecode
50 50 TestEmbeddedPruneSafetyAndScope
50 50 TestEmbeddedStale

View file

@ -1301,12 +1301,16 @@ jobs:
# cap per sh_test-like rule ("Having more than 50 shards is indicative of
# poor test organization. Please reduce the number of shards." -- a
# native analysis-time error, not a style lint); on rbe-west its shards
# ran 83-209s (6.5k shard-seconds, 2026-10-09), so it, not storage or
# //internal/httpclient:httpclient_served_test, is this lane's floor.
# Lowering it needs per-test speedups spread across the suite or
# splitting bd_embedded_test into multiple <=50-shard sh_test rules with
# shard-index-offset plumbing through tools/bazel/go_test_manifest_shard.sh
# and check_shard_coverage.py. On RBE the tier's wall time ~= that floor
# ran 83-209s (6.5k shard-seconds, 2026-10-09) until bdInit seeded each
# workspace from a per-process schema template and the race bd
# subprocesses stopped sleeping 1s at exit (~4.1-4.4k shard-seconds,
# slowest shard ~140-160s, its slowest single tests ~100-130s under
# load), so it, not storage or //internal/httpclient:httpclient_served_test,
# is still this lane's floor. Lowering it further needs per-test speedups
# in its slowest functions; more shards (splitting bd_embedded_test into
# multiple <=50-shard sh_test rules with shard-index-offset plumbing
# through tools/bazel/go_test_manifest_shard.sh and
# check_shard_coverage.py) would not move the slowest single test. On RBE the tier's wall time ~= that floor
# + fixed cost (checkout, build, shard dispatch), not ~=
# sum(durations)/shard_count the way a CPU-core-bound local sweep is --
# each shard is its own remote action and runs concurrently with every

View file

@ -731,6 +731,7 @@ go_test(
"duplicates_embedded_test.go",
"duplicates_proxied_integration_test.go",
"duplicates_test.go",
"embedded_init_template_test.go",
"envfile_test.go",
"epic_embedded_test.go",
"epic_proxied_integration_test.go",
@ -1432,12 +1433,22 @@ sh_test(
":go_srcs",
"//:.github/scripts/embedded-cmd-test-shards.txt",
"//:.github/scripts/embedded-test-shard.sh",
"//internal/storage/embeddeddolt/cmd:cmd_norace",
"@go_sdk//:bin/gofmt",
],
env = {
"BEADS_TEST_BD_BINARY": "$(rlocationpath :bd)",
"BEADS_TEST_EMBEDDED_DOLT": "1",
# bdInit's schema template (embedded_init_template_test.go), migrated
# by a non-race build of the embeddeddolt open tool.
"BEADS_TEST_EMBEDDED_SCHEMA_TOOL": "$(rlocationpath //internal/storage/embeddeddolt/cmd:cmd_norace)",
"BEADS_TEST_GOFMT": "$(rlocationpath @go_sdk//:bin/gofmt)",
# The race runtime sleeps 1s before every process exit by default
# (atexit_sleep_ms) so goroutines still running can report a race;
# the bd subprocesses (hundreds per shard, each a few seconds) exit
# through it every time. Races they hit while running still fail
# the command (exit 66) as before.
"GORACE": "atexit_sleep_ms=0",
},
shard_count = 50,
tags = ["embedded"],

View file

@ -0,0 +1,239 @@
//go:build cgo
package main
import (
"context"
"fmt"
"io/fs"
"os"
"os/exec"
"path/filepath"
"sync"
"testing"
"github.com/steveyegge/beads/internal/configfile"
"github.com/steveyegge/beads/internal/storage/embeddeddolt"
"github.com/steveyegge/beads/internal/testutil/bazeltest"
)
// freshInitEnv makes bdInit leave every workspace's schema to its own
// `bd init` instead of seeding it from the per-process schema template
// (seedEmbeddedSchema), to check that a failure does not depend on the seed.
const freshInitEnv = "BEADS_TEST_FRESH_INIT"
// schemaTemplateDatabase is the template's database directory name; each
// seed is renamed to the workspace's own database name.
const schemaTemplateDatabase = "schematemplate"
var (
schemaTemplateOnce sync.Once
schemaTemplateDir string
schemaTemplateErr error
)
// schemaToolEnv names a non-race build of
// internal/storage/embeddeddolt/cmd (runfiles path) for embeddedSchemaTemplate
// to run instead of migrating in this process, which under -race takes ~20s.
const schemaToolEnv = "BEADS_TEST_EMBEDDED_SCHEMA_TOOL"
// embeddedSchemaTemplate creates one embedded Dolt database per test process
// with every schema migration applied and nothing else (embeddeddolt.Open on
// an empty directory, as bd init's own open does), under testTempRoot, and
// returns its database directory.
func embeddedSchemaTemplate() (string, error) {
schemaTemplateOnce.Do(func() {
beadsDir, err := testTempDir("bd-schema-template-*")
if err != nil {
schemaTemplateErr = fmt.Errorf("create schema template dir: %w", err)
return
}
if err := migrateSchemaTemplate(beadsDir); err != nil {
schemaTemplateErr = fmt.Errorf("migrate schema template in %s: %w", beadsDir, err)
return
}
schemaTemplateDir = filepath.Join(beadsDir, "embeddeddolt", schemaTemplateDatabase)
})
return schemaTemplateDir, schemaTemplateErr
}
func migrateSchemaTemplate(beadsDir string) error {
if os.Getenv(schemaToolEnv) == "" {
store, err := embeddeddolt.Open(context.Background(), beadsDir, schemaTemplateDatabase, "main")
if err != nil {
return err
}
return store.Close()
}
tool, err := bazeltest.RunfileEnv(schemaToolEnv)
if err != nil {
return err
}
out, err := exec.Command(tool, "--dir", beadsDir, "--database", schemaTemplateDatabase).CombinedOutput()
if err != nil {
return fmt.Errorf("%s: %w\n%s", tool, err, out)
}
return nil
}
// seededInitDatabase returns the embedded database name `bd init --quiet
// <extraArgs>` creates, and false when bdInit should not seed it: an argument
// it does not know (it may pick another mode or location), no --prefix (the
// name then comes from the directory), or BEADS_TEST_FRESH_INIT=1.
func seededInitDatabase(extraArgs []string) (string, bool) {
if os.Getenv(freshInitEnv) == "1" {
return "", false
}
var prefix, database string
for i := 0; i < len(extraArgs); i++ {
switch extraArgs[i] {
case "--prefix", "--database":
if i+1 == len(extraArgs) {
return "", false
}
if extraArgs[i] == "--prefix" {
prefix = extraArgs[i+1]
} else {
database = extraArgs[i+1]
}
i++
case "--quiet", "--skip-hooks", "--skip-agents", "--non-interactive":
default:
return "", false
}
}
if prefix == "" {
return "", false
}
if database != "" {
return database, true
}
return dbNameFromPrefix(normalizeIssuePrefix(prefix)), true
}
// seedEmbeddedSchema copies the schema template into dir's .beads as database
// before bd init runs there. bd init then opens a database whose migrations
// are all applied, so it skips the migration chain (one Dolt commit per
// migration: most of an init's cost under -race) and does everything else
// itself: identity, issue prefix, config, hooks, agent files, the git commit.
// Seeded workspaces share the template's migration commits as their history.
func seedEmbeddedSchema(t *testing.T, dir, database string) {
t.Helper()
tmpl, err := embeddedSchemaTemplate()
if err != nil {
t.Fatalf("%v", err)
}
dst := filepath.Join(dir, ".beads", "embeddeddolt", database)
if err := copyTree(tmpl, dst); err != nil {
t.Fatalf("seed embedded schema %s into %s: %v", tmpl, dst, err)
}
}
// requireSeededEmbeddedInit fails unless bd init kept the seeded database as
// the workspace's embedded database.
func requireSeededEmbeddedInit(t *testing.T, beadsDir, database string) {
t.Helper()
cfg, err := configfile.Load(beadsDir)
if err != nil || cfg == nil {
t.Fatalf("bd init on a seeded schema: load %s/metadata.json: cfg=%v err=%v", beadsDir, cfg, err)
}
if cfg.DoltMode != configfile.DoltModeEmbedded || cfg.DoltDatabase != database {
t.Fatalf("bd init on a seeded schema chose mode %q database %q, want embedded %q; teach seededInitDatabase this case or run with %s=1",
cfg.DoltMode, cfg.DoltDatabase, database, freshInitEnv)
}
}
// copyTree copies src's tree to dst, keeping file and directory modes.
func copyTree(src, dst string) error {
return filepath.WalkDir(src, func(path string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
rel, err := filepath.Rel(src, path)
if err != nil {
return err
}
target := filepath.Join(dst, rel)
info, err := d.Info()
if err != nil {
return err
}
switch {
case d.IsDir():
if err := os.MkdirAll(target, 0o700); err != nil {
return err
}
return os.Chmod(target, info.Mode().Perm()|0o700)
case d.Type().IsRegular():
b, err := os.ReadFile(path)
if err != nil {
return err
}
if err := os.WriteFile(target, b, info.Mode().Perm()); err != nil {
return err
}
return os.Chmod(target, info.Mode().Perm())
default:
return fmt.Errorf("unexpected file type %s at %s", d.Type(), path)
}
})
}
func TestSeededInitDatabase(t *testing.T) {
t.Setenv(freshInitEnv, "")
for _, tt := range []struct {
args []string
want string
ok bool
}{
{[]string{"--prefix", "gc"}, "gc", true},
{[]string{"--prefix", "my-proj", "--skip-hooks", "--skip-agents"}, "my_proj", true},
{[]string{"--prefix", "a.b"}, "a_b", true},
{[]string{"--database", "shared_db", "--prefix", "alpha"}, "shared_db", true},
{nil, "", false},
{[]string{"--prefix"}, "", false},
{[]string{"--prefix", "gc", "--server"}, "", false},
{[]string{"--prefix", "gc", "--role", "contributor"}, "", false},
} {
got, ok := seededInitDatabase(tt.args)
if got != tt.want || ok != tt.ok {
t.Errorf("seededInitDatabase(%q) = %q, %v; want %q, %v", tt.args, got, ok, tt.want, tt.ok)
}
}
t.Setenv(freshInitEnv, "1")
if _, ok := seededInitDatabase([]string{"--prefix", "gc"}); ok {
t.Errorf("seededInitDatabase seeds with %s=1", freshInitEnv)
}
}
func TestCopyTreeKeepsModes(t *testing.T) {
src, dst := t.TempDir(), filepath.Join(t.TempDir(), "copy")
if err := os.MkdirAll(filepath.Join(src, "noms"), 0o750); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(filepath.Join(src, "noms", "manifest"), []byte("m"), 0o600); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(filepath.Join(src, "hook"), []byte("#!/bin/sh\n"), 0o755); err != nil {
t.Fatal(err)
}
if err := copyTree(src, dst); err != nil {
t.Fatalf("copyTree: %v", err)
}
if b, err := os.ReadFile(filepath.Join(dst, "noms", "manifest")); err != nil || string(b) != "m" {
t.Fatalf("copied manifest = %q, %v", b, err)
}
for path, want := range map[string]os.FileMode{
filepath.Join(dst, "noms"): 0o750,
filepath.Join(dst, "noms", "manifest"): 0o600,
filepath.Join(dst, "hook"): 0o755,
} {
info, err := os.Stat(path)
if err != nil {
t.Fatal(err)
}
if info.Mode().Perm() != want {
t.Errorf("%s mode = %v, want %v", path, info.Mode().Perm(), want)
}
}
}

View file

@ -189,13 +189,22 @@ func bdRunWithFlockRetry(t *testing.T, bd, dir string, args ...string) ([]byte,
// bdInit creates a temp dir with a git repo, runs bd init --quiet with the
// given extra args, and returns (dir, beadsDir, combined output).
// Fatals if bd init fails.
// Fatals if bd init fails. bd init runs on a schema already migrated from a
// per-process template (seedEmbeddedSchema) when seededInitDatabase knows the
// arguments.
func bdInit(t *testing.T, bd string, extraArgs ...string) (dir, beadsDir string, out string) {
t.Helper()
dir = t.TempDir()
initGitRepoAt(t, dir)
database, seeded := seededInitDatabase(extraArgs)
if seeded {
seedEmbeddedSchema(t, dir, database)
}
out = runBDInit(t, bd, dir, extraArgs...)
beadsDir = filepath.Join(dir, ".beads")
if seeded {
requireSeededEmbeddedInit(t, beadsDir, database)
}
return
}
@ -1597,12 +1606,23 @@ func TestEmbeddedInitRoleRouting(t *testing.T) {
}
}
func TestEmbeddedInitSelectedExcludeRouting(t *testing.T) {
// The selected-exclude routing cases are two top-level tests, not one: each
// case is a full embedded init under -race and they cannot run in parallel
// (t.Setenv), so one function held a whole Bazel shard for ~2 minutes.
func TestEmbeddedInitSelectedExcludeRoutingStealth(t *testing.T) {
testEmbeddedInitSelectedExcludeRouting(t, "stealth_decoy", "stealth_invalid", "quiet_stealth")
}
func TestEmbeddedInitSelectedExcludeRoutingFork(t *testing.T) {
testEmbeddedInitSelectedExcludeRouting(t, "fork_decoy", "fork_invalid", "quiet_fork", "fork_auto_invalid")
}
func testEmbeddedInitSelectedExcludeRouting(t *testing.T, names ...string) {
if os.Getenv("BEADS_TEST_EMBEDDED_DOLT") != "1" {
t.Skip("set BEADS_TEST_EMBEDDED_DOLT=1 to run embedded dolt init tests")
}
bd := buildEmbeddedBD(t)
for _, name := range []string{"stealth_decoy", "stealth_invalid", "fork_decoy", "fork_invalid", "quiet_stealth", "quiet_fork", "fork_auto_invalid"} {
for _, name := range names {
t.Run(name, func(t *testing.T) {
target, decoy, home := newInitRoleFixture(t)
global := filepath.Join(home, ".gitconfig")

View file

@ -22,6 +22,24 @@ go_binary(
visibility = ["//:__subpackages__"],
)
# The same tool built without the race detector whatever the configuration,
# for //cmd/bd:bd_embedded_test's schema template: run once per shard, it
# migrates an empty database in seconds instead of the ~20s it takes under
# --config=embedded's race. cgo-only, as :cmd.
go_binary(
name = "cmd_norace",
testonly = True,
out = "cmd_norace/schema",
embed = [":cmd_lib"],
race = "off",
tags = ["cgo-only"],
target_compatible_with = select({
"//tools/bazel:pure": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
visibility = ["//cmd/bd:__pkg__"],
)
# --- begin go_srcs (managed by tools/bazel/go_srcs.py; run `make bazel-sync`) ---
filegroup(

View file

@ -8,8 +8,8 @@ machinery, generalized so both embedded generators (and any future one) share
one implementation instead of two independently-maintained copies. The
per-suite scripts own discovery (the test-name regex/glob), the duration-file
path and its "seconds_per_init_fallback" semantics, and the manifest header
text; this module owns everything suite-agnostic: pack(), incremental_pack(),
split_blocks()/write_block(), and check_coverage().
text; this module owns everything suite-agnostic: pack(), pack_concurrent(),
incremental_pack(), split_blocks()/write_block(), and check_coverage().
See gen_proxied_shard_manifest.py's module docstring for the full rationale
behind incremental --write (merge-conflict avoidance across unrelated PRs)
@ -32,6 +32,35 @@ def pack(costs, total):
return shards, loads
def shard_wall(names, costs, serial, parallelism):
"""Estimated wall time of one Go test process running `names`:
top-level tests that do not call t.Parallel (`serial`) run one after
another before the parallel ones, which then share `parallelism`
(-test.parallel) slots, so the parallel group takes at least its longest
test and at least its total spread over the slots."""
ser = sum(costs[n] for n in names if n in serial)
par = [costs[n] for n in names if n not in serial]
return ser + max(max(par, default=0.0), sum(par) / parallelism)
def pack_concurrent(costs, total, serial, parallelism):
"""Greedy bin-pack for a Go test process that runs tests concurrently:
longest first, each onto the shard whose estimated wall time
(shard_wall) grows least, ties to the lighter shard. Plain LPT (pack())
sums durations, which for a -test.parallel binary overstates a shard of
several parallel tests and understates one holding a serial test.
Returns (shards, walls)."""
order = sorted(costs, key=lambda k: (-costs[k], k))
shards = [[] for _ in range(total)]
walls = [0.0] * total
for name in order:
best = min(range(total), key=lambda i: (
shard_wall(shards[i] + [name], costs, serial, parallelism), walls[i], i))
shards[best].append(name)
walls[best] = shard_wall(shards[best], costs, serial, parallelism)
return shards, walls
def split_blocks(text):
"""Split a manifest file's text into its per-total_shards blocks.

View file

@ -1,315 +1,290 @@
{
"_comment": [
"Measured locally with `bazel --nohome_rc test --config=embedded",
"//cmd/bd:bd_embedded_test --local_test_jobs=8` alongside the storage-tier",
"and conformance targets below (all four run in the same invocation, the",
"same way bazel.yml's bazel-embedded tier runs its shards concurrently on",
"one host) -- race, `-test.parallel=4`, tag filter `embedded`, run with the",
"real committed 40-shard manifest (.github/scripts/embedded-cmd-test-shards.txt)",
"so every one of the 242 TestEmbedded* functions that existed at capture time",
"ran exactly once (local sandboxed execution only; no remote executor or",
"cache flags were configured for this measurement run).",
"Measured on rbe-west, the lane's own remote executors (instance oss), on",
"2026-10-09: two `bazel test --config=embedded --nocache_test_results",
"//cmd/bd:bd_embedded_test` runs (race, `-test.parallel=4`, 50 shards), so",
"every top-level TestEmbedded* function ran exactly once per run. Each value",
"is the mean of the two runs (the two split",
"TestEmbeddedInitSelectedExcludeRouting{Stealth,Fork} functions ran only in",
"the second). The runs were taken after bdInit started seeding each",
"workspace's embedded database from a per-process schema template",
"(cmd/bd/embedded_init_template_test.go) and the bd subprocesses stopped",
"sleeping 1s at exit (GORACE=atexit_sleep_ms=0 on the target): the sum of",
"test-seconds fell from ~20.2k to ~10.3k on the same executors. Individual",
"tests varied up to ~2x between the two runs with executor load; the sum",
"moved ~4%. The previous capture was local sandboxed execution and",
"correlated only ~0.4 with rbe-west shard times.",
"",
"Each value is that top-level test's own <testcase time=...> from Bazel's",
"generated test.xml, NOT the enclosing <testsuite time=...>. For this Go test",
"binary / Bazel version, <testsuite time> was found empirically to be a",
"wall-clock-since-binary-start timestamp (it does not isolate a concurrently",
"-run top-level test's own duration under -test.parallel=4), whereas",
"<testcase time> matched the test binary's own `--- PASS: TestX (Ys)` line",
"exactly. Do not switch this capture to <testsuite time> without",
"re-verifying that relationship for the toolchain in use at the time.",
"generated test.xml, NOT the enclosing <testsuite time=...>: <testsuite",
"time> is a wall-clock-since-binary-start timestamp that does not isolate a",
"concurrently-run top-level test's own duration under -test.parallel=4,",
"while <testcase time> matches the test binary's own `--- PASS: TestX (Ys)`",
"line. Go adds a parallel test's elapsed time to its duration before it",
"waits for a parallel slot, so slot wait is not counted.",
"",
"F1 review correction (S1): an earlier pass of this file explained four",
"outliers (TestEmbeddedUpdateConcurrent, TestEmbeddedCloseConcurrent,",
"TestEmbeddedInitA, TestEmbeddedEpicCloseEligibleReason) as a",
"\"queueing-delay\" artifact of Go's t.Parallel() clock starting before a",
"test's parallel slot is granted, and shipped corrected-down weights on",
"that theory. That explanation was WRONG and has been retracted: Go's",
"testing package (testing.go's (*T).Parallel) adds the elapsed time to",
"t.duration BEFORE blocking on the parallel-slot barrier, so queued-for-a-",
"slot wait time is never counted in a test's own reported duration in the",
"first place. The original large numbers were genuine CPU-bound running",
"time under real resource contention (dozens of Bazel shards running",
"concurrently on one host, each internally up to -test.parallel=4) -- this",
"capture re-measures every test under exactly that condition (all 54",
"cmd+storage+conformance shards running together, not solo) instead of",
"mixing solo-measured corrections into a contended-capture baseline.",
"The generator packs these with a model of the shard process",
"(_embedded_shard_manifest_lib.py's pack_concurrent): functions without a",
"top-level t.Parallel() run one after another, before the parallel ones,",
"which share -test.parallel=4 slots.",
"",
"Two of those four outliers (TestEmbeddedUpdateConcurrent,",
"TestEmbeddedCloseConcurrent) are synthetic many-worker concurrency stress",
"tests whose cost is dominated by serialized `bd` subprocess invocations",
"behind the embedded engine's single-writer lock, not by -test.parallel",
"contention; their recorded values below are post-fix estimates (measured",
"value x 0.4) after cutting issuesPerWorker from 5 to 2 in both tests (see",
"their doc comments in update_embedded_test.go / close_embedded_test.go) --",
"pending a fresh capture to confirm. TestEmbeddedEpicCloseEligibleReason",
"was split into TestEmbeddedEpicCloseEligibleReasonFlag (3 subtests) and",
"TestEmbeddedEpicCloseEligibleReasonOutput (2 subtests); their recorded",
"values are the measured combined total apportioned 3:2 by subtest count,",
"also pending a fresh capture. TestEmbeddedInitA needed no further action:",
"at ~196s under this consistent methodology it is close to but under the",
"~200s single-test isolation threshold.",
"`seconds_per_init_fallback` is sum(durations) / sum(inits) over every test",
"here (inits: discover_inits_cost()'s t.Run( count proxy), used only for a",
"brand-new test with no entry yet.",
"",
"Every test measuring at or above ~200s under this consistent load is",
"pinned alone on its own shard in the generated manifest below (see that",
"file's header); LPT bin-packing does this automatically as long as the",
"weight is accurate, since no combination of lighter tests sums close to",
"a ~200s+ single item without the packer preferring to isolate it.",
"",
"`seconds_per_init_fallback` is the weighted average seconds-per-init over",
"every measured test in this file (sum of all durations / sum of all inits,",
"where inits is discover_inits_cost()'s t.Run( count proxy), used only for a",
"brand-new test with no entry yet (see",
"scripts/ci/gen_embedded_cmd_shard_manifest.py's discover_inits_cost()).",
"",
"As with the proxied tier's duration file, these are a relative weight for",
"LPT bin-packing, not an absolute SLA: within-shard -test.parallel=4",
"overlap, farm noisy-neighbor effects, and future code changes all mean a",
"shard's total packed cost is a planning estimate, not a guarantee."
"These are a relative weight for packing, not an absolute SLA."
],
"seconds_per_init_fallback": 19.4828,
"seconds_per_init_fallback": 9.5837,
"tests": {
"TestEmbeddedAdminBlocked": 20.33,
"TestEmbeddedAdminCompactReadOnlyAllowed": 21.99,
"TestEmbeddedAdminCompactTier2Honesty": 25.2,
"TestEmbeddedAutoImportFallback_ConflictSkip_DoesNotClobber": 28.23,
"TestEmbeddedAutoImportFallback_ConflictSkip_EmptyDBImportsAll": 23.63,
"TestEmbeddedAutoImportJSONLConcurrentWriter": 34.41,
"TestEmbeddedAutoImportJSONLNoExplicitCommit": 64.27,
"TestEmbeddedAutoImportJSONLSkipsNonEmpty": 27.53,
"TestEmbeddedBackup": 162.68,
"TestEmbeddedBackupConcurrent": 45.4,
"TestEmbeddedBlocked": 35.34,
"TestEmbeddedBlockedConcurrent": 51.71,
"TestEmbeddedBlockedLabelFilters": 66.12,
"TestEmbeddedBootstrap": 133.62,
"TestEmbeddedBootstrapConcurrent": 23.4,
"TestEmbeddedBranch": 128.64,
"TestEmbeddedBranchConcurrent": 36.84,
"TestEmbeddedChangeDirOverridesInheritedBeadsDir": 62.33,
"TestEmbeddedChildren": 86.18,
"TestEmbeddedChildrenConcurrent": 104.16,
"TestEmbeddedClaimPools": 78.4,
"TestEmbeddedCloseAlreadyClosed": 179.15,
"TestEmbeddedCloseBasic": 158.81,
"TestEmbeddedCloseConcurrent": 129.7,
"TestEmbeddedCloseGuardsAndEpics": 105.86,
"TestEmbeddedComments": 30.42,
"TestEmbeddedCommentsCLI": 89.97,
"TestEmbeddedCommentsCLIConcurrent": 38.85,
"TestEmbeddedCompact": 166.61,
"TestEmbeddedCompactConcurrent": 28.81,
"TestEmbeddedCompactMisdatedChild": 33.71,
"TestEmbeddedConfig": 83.45,
"TestEmbeddedConfigConcurrent": 96.47,
"TestEmbeddedConfigNoWorkspaceStoreFreeCommands": 6.09,
"TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout": 0.35,
"TestEmbeddedContext": 68.26,
"TestEmbeddedContextConcurrent": 22.8,
"TestEmbeddedContributorCreate": 166.08,
"TestEmbeddedCount": 127.95,
"TestEmbeddedCountConcurrent": 122.44,
"TestEmbeddedCountIncludeEphemeral": 86.31,
"TestEmbeddedCountIncludeInfra": 80.89,
"TestEmbeddedCreateCommitPending": 41.89,
"TestEmbeddedCreateConcurrent": 39.83,
"TestEmbeddedCreateCrossRepo": 44.64,
"TestEmbeddedCreateCrossRepoDryRunWithParent": 62.24,
"TestEmbeddedCreateCrossRepoUninit": 45.69,
"TestEmbeddedCreateCrossRepoWithParent": 80.27,
"TestEmbeddedCreateDryRunCrossRepoDoesNotMigrateTarget": 48.57,
"TestEmbeddedCreateDryRunDoesNotMigrate": 28.63,
"TestEmbeddedCreateDryRunRepoDoesNotInitializeTarget": 24.56,
"TestEmbeddedCreateFormCommitsLabelOnlyCreate": 31.46,
"TestEmbeddedCreateGraphAndBulk": 114.91,
"TestEmbeddedCreateJSONEchoesSubSecondTimestamps": 32.3,
"TestEmbeddedCreateRepoFromNonBeadsCwd": 23.45,
"TestEmbeddedCreateRepoProxiedTargetError": 45.4,
"TestEmbeddedCreateRepoRelativeExistingWorkspaceUnaffected": 45.93,
"TestEmbeddedCreateRepoRelativeUninitRefused": 24.13,
"TestEmbeddedCreateScalarAndRelationships": 191.35,
"TestEmbeddedCreateStorageClassBasic": 111.77,
"TestEmbeddedCreateStorageClassBatchAndMisc": 163.68,
"TestEmbeddedCreateStorageClassConflicts": 93.79,
"TestEmbeddedCreateWithGitRemote": 25.17,
"TestEmbeddedDefer": 92.03,
"TestEmbeddedDeferAutoWake": 79.42,
"TestEmbeddedDeferConcurrent": 121.28,
"TestEmbeddedDelete": 122.43,
"TestEmbeddedDeleteJSONDependencyErrorContract": 58.17,
"TestEmbeddedDepA": 175.73,
"TestEmbeddedDepAddWispSource": 58.14,
"TestEmbeddedDepAndLinkBatchAutoCommitDoesNotAdvanceHead": 132.31,
"TestEmbeddedDepB": 176.75,
"TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate": 38.51,
"TestEmbeddedDepConcurrent": 150.67,
"TestEmbeddedDepListSingleIDWarnsOnDroppedExternalEdge": 66.98,
"TestEmbeddedDepNoCycleCheck": 88.95,
"TestEmbeddedDiff": 56.44,
"TestEmbeddedDiffConcurrent": 68.69,
"TestEmbeddedDirectCommitPathsBatchAutoCommitDoesNotAdvanceHead": 174.02,
"TestEmbeddedDoltBlockedAndCommit": 59.12,
"TestEmbeddedDoltConcurrent": 68.7,
"TestEmbeddedDoltRemoteAndPush": 136.04,
"TestEmbeddedDuplicate": 72.32,
"TestEmbeddedDuplicateConcurrent": 69.38,
"TestEmbeddedDuplicates": 173.68,
"TestEmbeddedDuplicatesConcurrent": 59.24,
"TestEmbeddedEpicCloseEligible": 149.47,
"TestEmbeddedEpicCloseEligibleReasonFlag": 169.79,
"TestEmbeddedEpicCloseEligibleReasonOutput": 113.2,
"TestEmbeddedEpicConcurrent": 142.99,
"TestEmbeddedEpicStatus": 95.11,
"TestEmbeddedExplicitHierarchicalParentEdges": 65.84,
"TestEmbeddedExportConcurrent": 44.93,
"TestEmbeddedExportFlags": 130.38,
"TestEmbeddedExportFormats": 115.36,
"TestEmbeddedExternalCapabilityReadyAfterShip": 63.55,
"TestEmbeddedExternalMutationPolicy": 116.06,
"TestEmbeddedFederationConcurrent": 31.34,
"TestEmbeddedFederationPeers": 146.53,
"TestEmbeddedFederationStatus": 133.93,
"TestEmbeddedFindDuplicates": 124.62,
"TestEmbeddedFindDuplicatesConcurrent": 70.27,
"TestEmbeddedFlatten": 161.6,
"TestEmbeddedFlattenConcurrent": 32.13,
"TestEmbeddedGC": 185.65,
"TestEmbeddedGCConcurrent": 40.17,
"TestEmbeddedGate": 181.85,
"TestEmbeddedGateConcurrent": 66.94,
"TestEmbeddedGateCreate": 123.16,
"TestEmbeddedGateListScoped": 38.87,
"TestEmbeddedGetDependencies": 59.85,
"TestEmbeddedGraph": 81.16,
"TestEmbeddedGraphConcurrent": 88.99,
"TestEmbeddedHistory": 109.52,
"TestEmbeddedHistoryConcurrent": 90.07,
"TestEmbeddedHooks": 27.53,
"TestEmbeddedHooksConcurrent": 23.45,
"TestEmbeddedHuman": 97.66,
"TestEmbeddedHumanConcurrent": 30.64,
"TestEmbeddedImportClosedChildWhoseParentWasDeleted": 21.26,
"TestEmbeddedImportConcurrent": 31.4,
"TestEmbeddedImportFromSources": 124.38,
"TestEmbeddedImportPromotedWispRoundtrip": 137.68,
"TestEmbeddedImportUpsertAndPrefixSync": 111.37,
"TestEmbeddedInfo": 41.38,
"TestEmbeddedInfoConcurrent": 39.05,
"TestEmbeddedInfoSuppressGitHooks": 33.35,
"TestEmbeddedInitA": 196.25,
"TestEmbeddedInitArtifactRouting": 22.67,
"TestEmbeddedInitB": 145.22,
"TestEmbeddedInitC": 23.58,
"TestEmbeddedInitConcurrent": 47.95,
"TestEmbeddedInitExplicitBeadsDirIsAuthoritative": 53.4,
"TestEmbeddedInitGitBootstrapRouting": 158.28,
"TestEmbeddedInitHooksRouting": 22.24,
"TestEmbeddedInitRoleRouting": 125.08,
"TestEmbeddedInitSelectedExcludeRouting": 153.06,
"TestEmbeddedKV": 48.98,
"TestEmbeddedKVConcurrent": 108.72,
"TestEmbeddedLabelAddRemove": 138.68,
"TestEmbeddedLabelConcurrent": 84.16,
"TestEmbeddedLabelEditReports": 138.9,
"TestEmbeddedLabelPropagateRename": 120.78,
"TestEmbeddedLint": 82.71,
"TestEmbeddedLintConcurrent": 75.72,
"TestEmbeddedListComments": 51.81,
"TestEmbeddedListConcurrent": 33.41,
"TestEmbeddedListFiltering": 239.7,
"TestEmbeddedListSearchAndOutput": 147.31,
"TestEmbeddedMaxRowsDepTreeAndDuplicates": 97.69,
"TestEmbeddedMaxRowsDoctorAndConfig": 90.88,
"TestEmbeddedMaxRowsGraph": 159.26,
"TestEmbeddedMaxRowsListBasic": 107.6,
"TestEmbeddedMaxRowsListLimitInteraction": 192.0,
"TestEmbeddedMaxRowsReady": 168.09,
"TestEmbeddedMaxRowsReadyMerge": 78.54,
"TestEmbeddedMemory": 130.17,
"TestEmbeddedMemoryConcurrent": 95.43,
"TestEmbeddedMigrate": 155.64,
"TestEmbeddedMigrateConcurrent": 32.07,
"TestEmbeddedOnboard": 25.75,
"TestEmbeddedOnboardConcurrent": 22.91,
"TestEmbeddedAdminBlocked": 17.82,
"TestEmbeddedAdminCompactReadOnlyAllowed": 2.5,
"TestEmbeddedAdminCompactTier2Honesty": 17.71,
"TestEmbeddedAutoImportFallback_ConflictSkip_DoesNotClobber": 18.77,
"TestEmbeddedAutoImportFallback_ConflictSkip_EmptyDBImportsAll": 11.63,
"TestEmbeddedAutoImportJSONLConcurrentWriter": 29.04,
"TestEmbeddedAutoImportJSONLNoExplicitCommit": 33.58,
"TestEmbeddedAutoImportJSONLSkipsNonEmpty": 8.05,
"TestEmbeddedBackup": 37.73,
"TestEmbeddedBackupConcurrent": 11.05,
"TestEmbeddedBlocked": 14.0,
"TestEmbeddedBlockedConcurrent": 28.59,
"TestEmbeddedBlockedLabelFilters": 21.34,
"TestEmbeddedBootstrap": 80.85,
"TestEmbeddedBootstrapConcurrent": 9.56,
"TestEmbeddedBranch": 25.91,
"TestEmbeddedBranchConcurrent": 27.48,
"TestEmbeddedChangeDirOverridesInheritedBeadsDir": 17.26,
"TestEmbeddedChildren": 71.69,
"TestEmbeddedChildrenConcurrent": 37.41,
"TestEmbeddedClaimPools": 19.91,
"TestEmbeddedCloseAlreadyClosed": 84.22,
"TestEmbeddedCloseBasic": 72.03,
"TestEmbeddedCloseConcurrent": 84.28,
"TestEmbeddedCloseGuardsAndEpics": 58.54,
"TestEmbeddedComments": 10.35,
"TestEmbeddedCommentsCLI": 50.71,
"TestEmbeddedCommentsCLIConcurrent": 29.98,
"TestEmbeddedCompact": 41.59,
"TestEmbeddedCompactConcurrent": 23.3,
"TestEmbeddedCompactMisdatedChild": 12.83,
"TestEmbeddedConfig": 44.69,
"TestEmbeddedConfigConcurrent": 82.94,
"TestEmbeddedConfigNoWorkspaceStoreFreeCommands": 0.95,
"TestEmbeddedConfigValidateJSONNoWorkspaceWritesStdout": 0.32,
"TestEmbeddedContext": 24.87,
"TestEmbeddedContextConcurrent": 13.71,
"TestEmbeddedContributorCreate": 87.03,
"TestEmbeddedCount": 59.63,
"TestEmbeddedCountConcurrent": 44.3,
"TestEmbeddedCountIncludeEphemeral": 24.09,
"TestEmbeddedCountIncludeInfra": 53.12,
"TestEmbeddedCreateCommitPending": 12.9,
"TestEmbeddedCreateConcurrent": 29.6,
"TestEmbeddedCreateCrossRepo": 43.14,
"TestEmbeddedCreateCrossRepoDryRunWithParent": 46.25,
"TestEmbeddedCreateCrossRepoUninit": 35.37,
"TestEmbeddedCreateCrossRepoWithParent": 41.61,
"TestEmbeddedCreateDryRunCrossRepoDoesNotMigrateTarget": 17.89,
"TestEmbeddedCreateDryRunDoesNotMigrate": 15.28,
"TestEmbeddedCreateDryRunRepoDoesNotInitializeTarget": 3.09,
"TestEmbeddedCreateFormCommitsLabelOnlyCreate": 3.25,
"TestEmbeddedCreateGraphAndBulk": 16.55,
"TestEmbeddedCreateJSONEchoesSubSecondTimestamps": 8.31,
"TestEmbeddedCreateRepoFromNonBeadsCwd": 12.31,
"TestEmbeddedCreateRepoProxiedTargetError": 21.86,
"TestEmbeddedCreateRepoRelativeExistingWorkspaceUnaffected": 56.2,
"TestEmbeddedCreateRepoRelativeUninitRefused": 4.97,
"TestEmbeddedCreateScalarAndRelationships": 57.97,
"TestEmbeddedCreateStorageClassBasic": 11.92,
"TestEmbeddedCreateStorageClassBatchAndMisc": 45.95,
"TestEmbeddedCreateStorageClassConflicts": 41.81,
"TestEmbeddedCreateWithGitRemote": 14.38,
"TestEmbeddedDefer": 38.48,
"TestEmbeddedDeferAutoWake": 48.29,
"TestEmbeddedDeferConcurrent": 63.55,
"TestEmbeddedDelete": 81.25,
"TestEmbeddedDeleteJSONDependencyErrorContract": 42.77,
"TestEmbeddedDepA": 95.56,
"TestEmbeddedDepAddWispSource": 28.54,
"TestEmbeddedDepAndLinkBatchAutoCommitDoesNotAdvanceHead": 50.02,
"TestEmbeddedDepB": 94.49,
"TestEmbeddedDepBulkNoCycleCheckKeepsWholeGraphGate": 30.7,
"TestEmbeddedDepConcurrent": 75.13,
"TestEmbeddedDepListSingleIDWarnsOnDroppedExternalEdge": 66.92,
"TestEmbeddedDepNoCycleCheck": 58.88,
"TestEmbeddedDiff": 41.65,
"TestEmbeddedDiffConcurrent": 49.97,
"TestEmbeddedDirectCommitPathsBatchAutoCommitDoesNotAdvanceHead": 44.86,
"TestEmbeddedDoltBlockedAndCommit": 23.54,
"TestEmbeddedDoltConcurrent": 35.01,
"TestEmbeddedDoltRemoteAndPush": 18.79,
"TestEmbeddedDuplicate": 50.93,
"TestEmbeddedDuplicateConcurrent": 43.52,
"TestEmbeddedDuplicates": 67.03,
"TestEmbeddedDuplicatesConcurrent": 41.37,
"TestEmbeddedEpicCloseEligible": 69.55,
"TestEmbeddedEpicCloseEligibleReasonFlag": 29.56,
"TestEmbeddedEpicCloseEligibleReasonOutput": 41.91,
"TestEmbeddedEpicConcurrent": 71.22,
"TestEmbeddedEpicStatus": 44.06,
"TestEmbeddedExplicitHierarchicalParentEdges": 42.56,
"TestEmbeddedExportConcurrent": 21.66,
"TestEmbeddedExportFlags": 33.17,
"TestEmbeddedExportFormats": 40.58,
"TestEmbeddedExternalCapabilityReadyAfterShip": 37.72,
"TestEmbeddedExternalMutationPolicy": 64.3,
"TestEmbeddedFederationConcurrent": 25.94,
"TestEmbeddedFederationPeers": 38.08,
"TestEmbeddedFederationStatus": 27.84,
"TestEmbeddedFindDuplicates": 46.3,
"TestEmbeddedFindDuplicatesConcurrent": 14.36,
"TestEmbeddedFlatten": 31.29,
"TestEmbeddedFlattenConcurrent": 23.66,
"TestEmbeddedGC": 73.04,
"TestEmbeddedGCConcurrent": 21.52,
"TestEmbeddedGCConditionalMatcherDecode": 47.53,
"TestEmbeddedGate": 82.88,
"TestEmbeddedGateConcurrent": 49.5,
"TestEmbeddedGateCreate": 106.42,
"TestEmbeddedGateInheritsDownParentChain": 16.67,
"TestEmbeddedGateListScoped": 24.41,
"TestEmbeddedGatedRendering": 35.48,
"TestEmbeddedGetDependencies": 32.27,
"TestEmbeddedGraph": 61.4,
"TestEmbeddedGraphConcurrent": 21.38,
"TestEmbeddedHistory": 51.11,
"TestEmbeddedHistoryConcurrent": 77.78,
"TestEmbeddedHooks": 12.87,
"TestEmbeddedHooksConcurrent": 9.27,
"TestEmbeddedHuman": 66.13,
"TestEmbeddedHumanConcurrent": 9.72,
"TestEmbeddedIfRevisionReopenGuardDirect": 25.66,
"TestEmbeddedImportClosedChildWhoseParentWasDeleted": 27.28,
"TestEmbeddedImportConcurrent": 9.73,
"TestEmbeddedImportFromSources": 34.15,
"TestEmbeddedImportPromotedWispRoundtrip": 47.53,
"TestEmbeddedImportUpsertAndPrefixSync": 30.33,
"TestEmbeddedInfo": 17.36,
"TestEmbeddedInfoConcurrent": 33.86,
"TestEmbeddedInfoSuppressGitHooks": 9.64,
"TestEmbeddedInitA": 130.47,
"TestEmbeddedInitArtifactRouting": 20.34,
"TestEmbeddedInitB": 74.62,
"TestEmbeddedInitC": 32.69,
"TestEmbeddedInitConcurrent": 41.45,
"TestEmbeddedInitExplicitBeadsDirIsAuthoritative": 52.89,
"TestEmbeddedInitGitBootstrapRouting": 85.16,
"TestEmbeddedInitHooksRouting": 20.7,
"TestEmbeddedInitRoleRouting": 87.59,
"TestEmbeddedInitSelectedExcludeRoutingFork": 40.08,
"TestEmbeddedInitSelectedExcludeRoutingStealth": 65.73,
"TestEmbeddedKV": 12.62,
"TestEmbeddedKVConcurrent": 89.53,
"TestEmbeddedLabelAddRemove": 75.79,
"TestEmbeddedLabelConcurrent": 73.39,
"TestEmbeddedLabelEditReports": 68.91,
"TestEmbeddedLabelPropagateRename": 62.05,
"TestEmbeddedLint": 48.55,
"TestEmbeddedLintConcurrent": 44.72,
"TestEmbeddedListComments": 33.84,
"TestEmbeddedListConcurrent": 18.84,
"TestEmbeddedListFiltering": 87.75,
"TestEmbeddedListSearchAndOutput": 69.79,
"TestEmbeddedMaxRowsDepTreeAndDuplicates": 61.67,
"TestEmbeddedMaxRowsDoctorAndConfig": 30.57,
"TestEmbeddedMaxRowsGraph": 57.33,
"TestEmbeddedMaxRowsListBasic": 72.66,
"TestEmbeddedMaxRowsListLimitInteraction": 97.48,
"TestEmbeddedMaxRowsReady": 37.02,
"TestEmbeddedMaxRowsReadyMerge": 38.06,
"TestEmbeddedMemory": 57.23,
"TestEmbeddedMemoryConcurrent": 61.83,
"TestEmbeddedMemoryCorpusBudget": 17.38,
"TestEmbeddedMigrate": 34.92,
"TestEmbeddedMigrateConcurrent": 12.19,
"TestEmbeddedOnboard": 10.21,
"TestEmbeddedOnboardConcurrent": 19.27,
"TestEmbeddedOpen_EmptyDatabaseRejected": 0.0,
"TestEmbeddedOrphans": 40.45,
"TestEmbeddedOrphansConcurrent": 65.99,
"TestEmbeddedPreviewDoesNotConsumeVersionMarker": 29.99,
"TestEmbeddedPrime": 32.69,
"TestEmbeddedPrimeChangeDirDefaultTemplateMatchesTarget": 4.13,
"TestEmbeddedPrimeChangeDirPrimesTarget": 6.83,
"TestEmbeddedPrimeChangeDirRedirectNoticeFollowsTarget": 5.69,
"TestEmbeddedPrimeConcurrent": 55.99,
"TestEmbeddedPromote": 24.64,
"TestEmbeddedPromoteCLI": 64.87,
"TestEmbeddedPromoteCLIConcurrent": 67.99,
"TestEmbeddedPruneDryRunAndFilters": 155.68,
"TestEmbeddedPruneSafetyAndScope": 163.85,
"TestEmbeddedPurgeBasics": 89.31,
"TestEmbeddedPurgeConcurrent": 38.42,
"TestEmbeddedPurgeFiltered": 131.05,
"TestEmbeddedPurgeWispsPlaneRetention": 119.54,
"TestEmbeddedQuery": 69.55,
"TestEmbeddedQueryConcurrent": 79.23,
"TestEmbeddedQuick": 108.95,
"TestEmbeddedQuickConcurrent": 52.9,
"TestEmbeddedQuickstart": 21.7,
"TestEmbeddedQuickstartConcurrent": 24.95,
"TestEmbeddedQuietFlagSuppressesSuccessOutput": 37.91,
"TestEmbeddedReady": 148.56,
"TestEmbeddedReadyClaimConcurrent": 37.22,
"TestEmbeddedReadyConcurrent": 39.82,
"TestEmbeddedRenamePrefixBasic": 111.8,
"TestEmbeddedRenamePrefixConcurrent": 30.67,
"TestEmbeddedRenamePrefixEdgeCases": 81.14,
"TestEmbeddedReopen": 105.91,
"TestEmbeddedReopenConcurrent": 112.14,
"TestEmbeddedRestore": 137.93,
"TestEmbeddedOrphans": 25.62,
"TestEmbeddedOrphansConcurrent": 31.05,
"TestEmbeddedPreviewDoesNotConsumeVersionMarker": 13.76,
"TestEmbeddedPrime": 17.08,
"TestEmbeddedPrimeChangeDirDefaultTemplateMatchesTarget": 0.87,
"TestEmbeddedPrimeChangeDirPrimesTarget": 0.95,
"TestEmbeddedPrimeChangeDirRedirectNoticeFollowsTarget": 0.85,
"TestEmbeddedPrimeConcurrent": 22.81,
"TestEmbeddedPromote": 13.89,
"TestEmbeddedPromoteCLI": 48.09,
"TestEmbeddedPromoteCLIConcurrent": 52.29,
"TestEmbeddedPruneDryRunAndFilters": 41.08,
"TestEmbeddedPruneSafetyAndScope": 63.09,
"TestEmbeddedPurgeBasics": 33.45,
"TestEmbeddedPurgeConcurrent": 28.04,
"TestEmbeddedPurgeFiltered": 40.47,
"TestEmbeddedPurgeWispsPlaneRetention": 76.18,
"TestEmbeddedQuery": 40.0,
"TestEmbeddedQueryConcurrent": 45.96,
"TestEmbeddedQuick": 51.42,
"TestEmbeddedQuickConcurrent": 61.4,
"TestEmbeddedQuickstart": 9.7,
"TestEmbeddedQuickstartConcurrent": 15.87,
"TestEmbeddedQuietFlagSuppressesSuccessOutput": 31.54,
"TestEmbeddedReadOnlyCommandsSpawnNoGit": 33.33,
"TestEmbeddedReady": 71.28,
"TestEmbeddedReadyClaimConcurrent": 26.71,
"TestEmbeddedReadyConcurrent": 32.41,
"TestEmbeddedReclaimRunsTheLeaseReclaimerRole": 26.56,
"TestEmbeddedRenamePrefixBasic": 46.34,
"TestEmbeddedRenamePrefixConcurrent": 18.87,
"TestEmbeddedRenamePrefixEdgeCases": 31.27,
"TestEmbeddedReopen": 59.7,
"TestEmbeddedReopenConcurrent": 76.86,
"TestEmbeddedRestore": 35.94,
"TestEmbeddedRestoreConcurrent": 0.0,
"TestEmbeddedRoutedMutatingSiblingAssignTagDep": 156.88,
"TestEmbeddedRoutedMutatingSiblingDeleteClose": 101.7,
"TestEmbeddedRoutedSiblingWritesCommitTargetHead": 191.64,
"TestEmbeddedSearch": 118.78,
"TestEmbeddedSearchConcurrent": 98.05,
"TestEmbeddedSetup": 52.64,
"TestEmbeddedSetupConcurrent": 22.64,
"TestEmbeddedShip": 71.62,
"TestEmbeddedShipConcurrent": 101.01,
"TestEmbeddedShowBasicsAndJSON": 118.13,
"TestEmbeddedShowConcurrent": 150.5,
"TestEmbeddedShowDetailAndCurrent": 135.15,
"TestEmbeddedShowUnresolvableDeps": 59.52,
"TestEmbeddedSquashWispMoleculeClearsRootEphemeral": 23.37,
"TestEmbeddedStale": 90.45,
"TestEmbeddedStaleConcurrent": 79.59,
"TestEmbeddedStaleLabelFilters": 84.1,
"TestEmbeddedState": 66.22,
"TestEmbeddedStateConcurrent": 45.78,
"TestEmbeddedStatus": 47.37,
"TestEmbeddedStatusConcurrent": 79.04,
"TestEmbeddedSupersede": 76.14,
"TestEmbeddedSupersedeConcurrent": 72.31,
"TestEmbeddedSwarm": 172.12,
"TestEmbeddedSwarmConcurrent": 71.02,
"TestEmbeddedTodo": 74.74,
"TestEmbeddedTodoConcurrent": 30.6,
"TestEmbeddedTypes": 46.4,
"TestEmbeddedTypesAgreeWithCreate": 109.4,
"TestEmbeddedTypesConcurrent": 29.96,
"TestEmbeddedUnclaim": 130.59,
"TestEmbeddedUndefer": 122.4,
"TestEmbeddedUndeferConcurrent": 121.9,
"TestEmbeddedUpdateBatchAutoCommitDoesNotAdvanceHead": 28.26,
"TestEmbeddedUpdateConcurrent": 180.79,
"TestEmbeddedUpdateFields": 142.3,
"TestEmbeddedUpdateLifecycle": 150.21,
"TestEmbeddedUpdateRoutedStoreCommitsTargetHead": 51.5,
"TestEmbeddedVCCommitVariantsAndMerge": 105.56,
"TestEmbeddedVCConcurrent": 56.84,
"TestEmbeddedVCStatusAndCommit": 126.19,
"TestEmbeddedVersion": 1.4,
"TestEmbeddedVersionConcurrent": 1.48,
"TestEmbeddedWhere": 55.16,
"TestEmbeddedWhereConcurrent": 27.1
"TestEmbeddedRoutedMutatingSiblingAssignTagDep": 105.3,
"TestEmbeddedRoutedMutatingSiblingDeleteClose": 74.67,
"TestEmbeddedRoutedSiblingWritesCommitTargetHead": 83.5,
"TestEmbeddedSearch": 65.75,
"TestEmbeddedSearchConcurrent": 61.47,
"TestEmbeddedSetup": 19.29,
"TestEmbeddedSetupConcurrent": 16.88,
"TestEmbeddedShip": 47.53,
"TestEmbeddedShipConcurrent": 68.2,
"TestEmbeddedShowBasicsAndJSON": 55.39,
"TestEmbeddedShowConcurrent": 77.92,
"TestEmbeddedShowDetailAndCurrent": 82.5,
"TestEmbeddedShowUnresolvableDeps": 56.8,
"TestEmbeddedSquashWispMoleculeClearsRootEphemeral": 26.27,
"TestEmbeddedStale": 63.39,
"TestEmbeddedStaleConcurrent": 46.3,
"TestEmbeddedStaleLabelFilters": 26.04,
"TestEmbeddedState": 55.29,
"TestEmbeddedStateConcurrent": 42.2,
"TestEmbeddedStatus": 29.52,
"TestEmbeddedStatusConcurrent": 53.34,
"TestEmbeddedSupersede": 46.47,
"TestEmbeddedSupersedeConcurrent": 70.75,
"TestEmbeddedSwarm": 97.32,
"TestEmbeddedSwarmConcurrent": 49.07,
"TestEmbeddedTodo": 49.91,
"TestEmbeddedTodoConcurrent": 19.93,
"TestEmbeddedTypes": 22.43,
"TestEmbeddedTypesAgreeWithCreate": 37.24,
"TestEmbeddedTypesConcurrent": 20.36,
"TestEmbeddedUnclaim": 78.85,
"TestEmbeddedUndefer": 52.25,
"TestEmbeddedUndeferConcurrent": 58.19,
"TestEmbeddedUpdateBatchAutoCommitDoesNotAdvanceHead": 14.69,
"TestEmbeddedUpdateConcurrent": 105.17,
"TestEmbeddedUpdateFields": 77.51,
"TestEmbeddedUpdateLifecycle": 73.02,
"TestEmbeddedUpdateRoutedStoreCommitsTargetHead": 45.79,
"TestEmbeddedVCCommitVariantsAndMerge": 14.78,
"TestEmbeddedVCConcurrent": 41.36,
"TestEmbeddedVCStatusAndCommit": 44.06,
"TestEmbeddedVersion": 0.35,
"TestEmbeddedVersionConcurrent": 0.53,
"TestEmbeddedWhere": 11.55,
"TestEmbeddedWhereConcurrent": 8.26
}
}

View file

@ -18,7 +18,9 @@ docstring for the full rationale this one shares):
scripts/ci/embedded_cmd_test_durations.json (see that file's header for
provenance). A function missing from that file — a test added since it
was last captured — falls back to its inits cost times the file's
"seconds_per_init_fallback" ratio.
"seconds_per_init_fallback" ratio. A from-scratch pack models the shard
process (pack_concurrent): functions without a top-level t.Parallel()
run one after another, the rest share -test.parallel=4 slots.
This file's existing 20-shard block (hand-assigned, round-robin; see its own
header) is the FROZEN block PR Risk's and main.yml's legacy fork/push jobs
@ -47,12 +49,15 @@ import sys
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from _embedded_shard_manifest_lib import ( # noqa: E402
check_coverage, incremental_pack, pack, read_assignments, write_block,
check_coverage, incremental_pack, pack, pack_concurrent, read_assignments, write_block,
)
default_manifest_path = '.github/scripts/embedded-cmd-test-shards.txt'
durations_filename = 'embedded_cmd_test_durations.json'
default_total_shards = 20
# .bazelrc's test:embedded --test_arg=-test.parallel=4: how many t.Parallel
# top-level tests one shard's process runs at once (--weights=duration).
test_parallelism = 4
func_re = re.compile(r'^func (TestEmbedded[A-Za-z0-9_]+)\(')
@ -78,6 +83,27 @@ def discover_inits_cost():
return costs
def discover_serial():
"""Return the TestEmbedded* functions whose body does not call
t.Parallel() directly: Go runs them one at a time, before the parallel
ones (a test that reaches t.Parallel only through a helper counts as
serial, which overestimates its shard)."""
serial = set()
for path in glob.glob('cmd/bd/*_embedded_test.go'):
with open(path) as fh:
lines = fh.readlines()
cur, parallel = None, False
for ln in lines + ['func \n']:
if ln.startswith('func '):
if cur and not parallel:
serial.add(cur)
m = func_re.match(ln)
cur, parallel = (m.group(1) if m else None), False
elif cur and ln.rstrip('\n') == '\tt.Parallel()':
parallel = True
return serial
def duration_cost(inits):
"""Return {test_name: seconds}, from the committed duration capture,
falling back to inits * seconds_per_init_fallback for an undated test."""
@ -115,9 +141,11 @@ def render(total, shards, weights):
else:
out.append(f'# {total}-shard split for the Bazel-only embedded-Dolt cmd tier')
out.append('# (bazel-embedded in .github/workflows/bazel.yml), bin-packed')
out.append('# longest-processing-time-first by measured wall-time from')
out.append('# longest-first by measured wall-time from')
out.append(f'# scripts/ci/{durations_filename} (see that file for provenance')
out.append('# and its "relative weight, not absolute SLA" caveat).')
out.append('# and its "relative weight, not absolute SLA" caveat) onto the shard')
out.append('# whose estimated wall time grows least: serial tests (no top-level')
out.append(f'# t.Parallel) add up, parallel ones share -test.parallel={test_parallelism}.')
out.append(f'# Regenerate with scripts/ci/gen_embedded_cmd_shard_manifest.py {total}')
out.append('# --weights=duration --write after adding, splitting or removing')
out.append('# TestEmbedded* functions in cmd/bd/*_embedded_test.go. --write is')
@ -180,6 +208,8 @@ def main():
existing = None if args.repack else read_assignments(args.manifest, args.total_shards)
if existing:
shards, loads = incremental_pack(costs, args.total_shards, existing)
elif args.weights == 'duration':
shards, loads = pack_concurrent(costs, args.total_shards, discover_serial(), test_parallelism)
else:
shards, loads = pack(costs, args.total_shards)
out = render(args.total_shards, shards, args.weights)

View file

@ -806,7 +806,12 @@ func TestBazelRetiredLanesCannotBeNarrowed(t *testing.T) {
want := map[string]target{
"//cmd/bd:bd_embedded_test": {
[]string{"$(rootpath //:.github/scripts/embedded-test-shard.sh)", "BEADS_TEST_CMD_BINARY", "$(rootpath :bd_test)", "-test.timeout=19m"},
map[string]string{"BEADS_TEST_BD_BINARY": "$(rlocationpath :bd)", "BEADS_TEST_EMBEDDED_DOLT": "1", "BEADS_TEST_GOFMT": "$(rlocationpath @go_sdk//:bin/gofmt)"},
map[string]string{
"BEADS_TEST_BD_BINARY": "$(rlocationpath :bd)", "BEADS_TEST_EMBEDDED_DOLT": "1", "BEADS_TEST_GOFMT": "$(rlocationpath @go_sdk//:bin/gofmt)",
// bdInit's schema template and the race runtime's exit sleep:
// neither selects or skips a test.
"BEADS_TEST_EMBEDDED_SCHEMA_TOOL": "$(rlocationpath //internal/storage/embeddeddolt/cmd:cmd_norace)", "GORACE": "atexit_sleep_ms=0",
},
},
"//internal/storage/embeddeddolt:embeddeddolt_embedded_test": {
[]string{"$(rootpath //:.github/scripts/embedded-storage-test-shard.sh)", "BEADS_TEST_EMBEDDED_TEST_BINARY", "$(rootpath :embeddeddolt_test)", "-test.timeout=19m"},

View file

@ -43,6 +43,35 @@ func TestCmdEmbeddedShardManifestGeneratorNotStale(t *testing.T) {
}
}
// TestPackConcurrentModelsSerialAndParallelTests pins
// _embedded_shard_manifest_lib.py's pack_concurrent: a serial test (no
// top-level t.Parallel) holds its shard alone for its whole duration, while
// parallel tests share -test.parallel slots, so four 30s parallel tests fit
// beside a 90s one in the same wall time. Plain LPT would put the serial
// test with a parallel one and split the rest evenly by summed duration.
func TestPackConcurrentModelsSerialAndParallelTests(t *testing.T) {
python := requireHostTool(t, "python3")
root := sourceRepoRoot(t)
const script = `
import sys
sys.path.insert(0, 'scripts/ci')
from _embedded_shard_manifest_lib import pack_concurrent
costs = {'serial': 100, 'a': 90, 'b': 80, 'c': 30, 'd': 30, 'e': 30, 'f': 30}
shards, walls = pack_concurrent(costs, 2, {'serial'}, 4)
print(sorted(map(sorted, shards)), walls)
`
cmd := exec.Command(python, "-c", script)
cmd.Dir = root
out, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("pack_concurrent: %v\n%s", err, out)
}
const want = "[['a', 'b', 'c', 'd', 'e', 'f'], ['serial']] [100.0, 90]\n"
if string(out) != want {
t.Errorf("pack_concurrent = %q, want %q", out, want)
}
}
// TestStorageEmbeddedShardManifestGeneratorNotStale mirrors
// TestCmdEmbeddedShardManifestGeneratorNotStale above for the storage tier's
// Bazel-only 20-shard block; see that test's doc comment.