Files
pulse/.github/scripts/internal-api-test-seconds.txt
T
courtmanr@gmail.com 06d78b66d3 Balance internal/api race shards by measured run time
The four Backend tests (api-N) shards took equal-count quarters of go
test's list, which left them at 4.0, 10.6, 4.0 and 16.8 minutes on the
first PR run, and at 1.9, 8.0, 1.5 and 10.3 minutes of go test time on
the following main push (run 36560070496). Almost all of it sits in a
few tests. One contract mock chart test runs about six minutes on the
runner, and the 28 integration server tests at the end of the list take
about twenty seconds each, so the fourth quarter held nearly half the
package.

Shards are still contiguous runs of go test's own order, since some
tests depend on package state from their neighbours, but the cut points
now come from estimated seconds.
.github/scripts/select-internal-api-shard.sh weighs each test from
.github/scripts/internal-api-test-seconds.txt (the 199 tests at 0.5s or
more, seeded from a local -race -json run scaled to that main run's
shard totals, with a 0.05s default for anything unlisted), binary
searches the smallest per-shard budget that fits the list into four
slices, and fills up to it. The weights only move cut points. Every test
is assigned exactly one shard in a single pass, so a stale file can
unbalance shards but never drop or repeat a test, and no shard is ever
empty.

With today's list the slices hold 1187, 23, 2556 and 21 tests, estimated
at 1.9, 6.9, 6.5 and 6.7 minutes of tests, or about 9.5 minutes per job
with the roughly 2.6 minutes of setup and race compile. The 2556-test
slice would need a 124 KB -run pattern, so a shard passes -skip of the
other shards' tests whenever that is shorter, which runs the same tests
in the same order.
2026-09-29 13:14:27 +01:00

213 lines
11 KiB
Plaintext

# Estimated -race run time in seconds of the slowest internal/api top-level
# tests on a GitHub ubuntu-24.04 runner. Used only by
# select-internal-api-shard.sh to choose where the Backend tests (api-N)
# shards cut go test's list. Tests not named here weigh DEFAULT_WEIGHT (0.05s,
# the measured mean of the unlisted tests). A missing, stale or renamed entry
# can make the shards uneven but can never drop or repeat a test.
#
# Refresh when one api shard runs well over the others: run
# GOMAXPROCS=4 go test -race -json ./internal/api
# and list every top-level test at 0.5s or more. Seeded 2026-09-29 from such a
# local run scaled to the four shard totals of Build and Test run 36560070496
# (the contract mock chart test runs about 1.4x slower on the runner, the
# wait-bound integration server tail about 0.8x).
TestActionRunnerRotationProductionRouterTLSPersistenceRestart 0.69
TestMockActionInboxAndDetailUseCanonicalResponses 2.40
TestMockActionInboxHonorsLimitAndLegacyPendingProjection 1.79
TestMockActionMutationsFailReadOnly 0.98
TestAgentReportHandlersClassifyBodyFailures 1.10
TestStart_MockModeStartsChatServiceWhenPersistedConfigDisabled 0.95
TestRestart_MockModeStartsChatServiceWhenPersistedConfigDisabled 0.95
TestHandleChat_EmitsIdleProgressWhileServiceIsSilent 2.40
TestAISettingsHandler_ProviderSettersConcurrentServiceCreation 8.31
TestHandleSaveGuestNote_VerifySavedFields 0.52
TestHandleClearGuestKnowledge_OversizedBody 0.57
TestHandlePatrolStream_LastEventIDHeaderTakesPrecedenceOverQueryFallback 1.99
TestHandleExecuteStream_LicenseRequired 1.05
TestHandleExecuteStream_PromptRequired 1.06
TestHandleExecuteStream_Success 1.80
TestHandleExecuteStream_EmitsIdleProgressWhileServiceIsSilent 1.74
TestHandleInvestigateAlert_EmitsIdleProgressWhileServiceIsSilent 1.69
TestAISettingsHandler_PatrolReadinessBranches 0.85
TestHandleInvestigateAlert_UsesVisibleIdleProgressStream 1.73
TestHandleGetPatterns_UnlockedWithData 1.04
TestHandleGetPredictions_WithData 1.04
TestHandleGetCorrelations_WithData 1.05
TestHandleGetCorrelations_UsesCanonicalIntelligenceFacade 1.04
TestExtractAndStoreAuthContext_UsesTenantConfigForToken 2.98
TestAuthDenialPruneKeepsTrackedSetBounded 1.92
TestAvailabilityHandlersListReturnsMockTargetsInMockMode 1.03
TestAvailabilityHandlersTestSavedMockTargetUsesSyntheticStatus 1.03
TestChangePasswordRefusesNonAdminSession 0.83
TestChangePasswordAllowsConfiguredAdminSession 1.52
TestChangePasswordBasicAuthPathUnaffected 4.19
TestChangePasswordFixtureOwnsRouterLifecycle 0.84
TestConfigTransferAnonymousAuthenticatedModesDenyBeforeBodyRead 0.50
TestConfigTransferAuthorizedInstanceModesReachHandler 0.70
TestConnectionsHandleListIncludesMockAvailabilityTargets 1.13
TestConnectionsHandleListDropsRealSourcesInMockMode 1.19
TestConnectionsLedgerKeepsRealSourcesWhenRealPollingRetained 1.15
TestContract_MockAvailabilityTargetsUseSavedTargetPayloads 1.13
TestContract_MockDiscoveryEndpointsUseCanonicalPayloads 1.05
TestContract_MockChartRoutesUseCanonicalMockUnifiedReadStateForVMwareHosts 391.48
TestContract_PlatformMockToggleRebindsRuntimeConnectionsAndResources 19.96
TestContract_PlatformMockConnectionListsUseSharedFixtureMetadata 1.08
TestContract_RecoveryPointsMockPathReturnsCanonicalProviderBackedFixtures 1.61
TestContract_SecurityStatusPresentationPolicyProEditionCommercialContext 0.50
TestContract_StateAndResourceListShareCanonicalMockResourceContract 4.64
TestContract_AgentCommandConfigGateMirrorsChannelAdmission 1.13
TestContract_HostedDiagnosticsDockerPrepareTokenValidatesOriginBeforeMutation 1.22
TestContract_HostedInstallerOriginsFailClosedAtRouter 4.04
TestContract_RuntimeDisplayServesPresentationValuesWithoutAdmin 0.84
TestSecurityStatusCurrentUserForScopedLocalSession 0.84
TestSecurityStatusOrgBoundSettingsFollowOrgManagementRule 0.84
TestSecurityStatusOrgBoundReportingRespectsAuthorizer 0.83
TestDiscoveryHandlers_MockModeServesFixturesWithoutService 1.13
TestDockerAgentReportSizeContractAcceptsOrdinaryAndLargeFleets 0.55
TestDockerAgentReportSizeContractBoundaries 2.57
TestCollectorUninstallTransactionFailsClosedAndRetriesAfterRestart 2.15
TestHostedTenantAgentInstallCommand_GeneratesOrgBoundTokenAndCommand 3.13
TestGenerateHostedTenantAgentInstallCommandEnforcesHostedOrgBoundary 1.11
TestHostedTenantAgentInstallCommandCarriesCommandPolicyIntent 1.49
TestHostedTenantAgentInstallTokenCannotReportToOtherTenant 0.50
TestIssue1753SameNameProxmoxAgentsAuthenticateAndStayDistinctEndToEnd 2.20
TestSyncReleaseDemoFixtureRuntime_DoesNotPoliceMockFixturesInDevBuilds 1.23
TestMetricsHistoryFallbackSynthesizesUnseededMockWorkloadHistory 1.64
TestMetricsHistoryFallbackSynthesizesMockHostAndNodeDrawerSeries 1.99
TestMetricsHistoryFallbackSupplementsPartialMockStoreSeries 1.68
TestMetricsHistoryFallbackMockDiskSynthesizesSeries 1.65
TestMetricsHistoryFallbackMockUnifiedStorageSynthesizesSeries 2.27
TestMetricsHistoryFallbackMockStorageBypassesSparseStoreSeries 2.47
TestSSOOnlyExplicitAdminReachesEveryAdminGuard 1.42
TestUnrelatedSSOUserStillRefusedWhenLocalAdminConfigured 2.10
TestPatrolActionBrokerAutonomyModeIsAnUpperBound 0.53
TestPlatformAdminRouteRefusesUnrelatedSSOUser 0.84
TestJourneyGeneralAPIBudgetIsolation 1.75
TestTenantRBACProvider_ConcurrentGetAndRemove 0.52
TestTenantRBACProvider_NoConnectionLeak 1.43
TestHandleListPointsAcceptsCanonicalPlatformQuery 1.82
TestHandleListRollupsExposeCanonicalPlatformsPayload 1.86
TestHandleListRollupsMetaReportsNormalizedPagination 2.71
TestHandleListPointsMetaReportsNormalizedPagination 2.74
TestStartPatrolForContext_DoesNotOverwriteOtherTenantPatrolComponents 2.30
TestStartPatrolForContext_RejectsMismatchedAIServiceOrg 1.24
TestRouterMockMode_SeedsTrueNASAndVMwareSupplementalResources 1.58
TestRouterMockMode_SeedsVMwareSupplementalActivity 1.21
TestRouteExecuteStream_Success 0.94
TestRouteExecuteStream_MethodNotAllowed 0.76
TestRouteExecuteStream_NoAuth 0.60
TestRouteExecuteStream_WrongScope 0.65
TestRouteExecuteStream_EmptyPrompt 0.83
TestRouteExecuteStream_WhitespaceOnlyPrompt 0.73
TestRouteExecuteStream_InvalidJSON 0.80
TestRouteExecuteStream_AIDisabled 0.78
TestRouteExecuteStream_AutofixLicenseRequired 0.75
TestRouteExecuteStream_RemediationLicenseRequired 0.66
TestRouteExecuteStream_OversizedBody 0.82
TestRouteExecuteStream_UseCaseCaseInsensitive 0.86
TestRouteExecuteStream_SSEHeaders 0.66
TestRouteExecuteStream_CompleteEventBeforeDone 0.76
TestRouteExecuteStream_EmptyBody 0.68
TestRouteExecuteStream_NullPrompt 0.74
TestRouteExecuteStream_EmptyJSONObject 0.55
TestRouteExecuteStream_ServiceError 0.69
TestRouteExecuteStream_InvalidTargetType 0.60
TestRouteExecuteStream_InvalidHistoryRole 0.70
TestRouteExecuteStream_TargetIDTooLong 0.58
TestRouteExecuteStream_ValidTargetTypes 2.08
TestRouteExecuteStream_EmptyTargetTypeAllowed 1.50
TestRouteExecuteStream_WithConversationHistory 0.58
TestRouteExecuteStream_WithTargetContext 0.75
TestRouteExecuteStream_DefaultUseCaseIsChat 0.73
TestRouteExecuteStream_FindingIDPassedThrough 0.73
TestRouteExecuteStream_ModelFieldPassedThrough 0.63
TestRouteExecute_Success 0.74
TestRouteExecute_MethodNotAllowed 0.75
TestRouteExecute_NoAuth 0.79
TestRouteExecute_WrongScope 0.69
TestRouteExecute_EmptyPrompt 0.74
TestRouteExecute_InvalidJSON 0.75
TestRouteExecute_WithConversationHistory 0.68
TestRouteExecute_WithTargetContext 0.87
TestRouteExecute_DefaultUseCaseIsChat 0.73
TestRouteExecute_AutofixLicenseRequired 0.75
TestRouteExecute_RemediationLicenseRequired 0.56
TestRouteExecute_OversizedBody 0.93
TestRouteExecute_EmptyBody 0.66
TestRouteExecute_EmptyJSONObject 0.94
TestRouteExecute_NullPrompt 0.75
TestRouteExecute_ServiceError 0.73
TestRouteExecute_InvalidTargetType 0.75
TestRouteExecute_ValidTargetTypes 2.17
TestRouteExecute_EmptyTargetTypeAllowed 0.75
TestRouteExecute_InvalidHistoryRole 0.73
TestRouteExecute_FindingIDPassedThrough 0.76
TestRouteExecute_ModelFieldPassedThrough 0.73
TestRouteListModels_Success 0.68
TestRouteListModels_MethodNotAllowed 0.66
TestRouteListModels_WrongScope 0.72
TestRouteListModels_ProviderError 0.75
TestRouteListModels_EmptyModelList 0.76
TestRouteListModels_ResponseContentType 0.63
TestRouteListModels_CachedField 0.76
TestRouteListModels_MalformedProviderResponse 0.78
TestRouteListModels_HEADMethod 0.87
TestRouteTestConnection_Success 0.76
TestRouteTestConnection_MethodNotAllowed 0.72
TestRouteTestConnection_NoAuth 0.74
TestRouteTestConnection_WrongScope 0.74
TestRouteTestProvider_Success 0.72
TestRouteTestProvider_UnconfiguredProvider 0.66
TestRouteTestProvider_ConnectionFailure 0.60
TestRouteTestProvider_MethodNotAllowed 0.76
TestRouteTestProvider_NoAuth 0.75
TestRouteTestProvider_MultipleProviders 0.74
TestRouteTestProvider_UnknownProvider 0.60
TestRouteTestProvider_WrongScope 0.75
TestRouteTestProvider_InvalidProviderNames 0.74
TestRouteTestProvider_PathTraversal 0.85
TestRouter_HandleState_MockIsolation 4.14
TestAITestConnectionRouteWithValidScope 0.75
TestAITestConnectionRouteRejectsWrongScope 0.82
TestAITestProviderRouteRejectsWrongScope 0.74
TestPublicEndpointsBypassAuthInAPIMode 0.61
TestSettingsCapabilitiesMatchRouteEnforcementWithoutRBAC 0.86
TestSettingsCapabilitiesGrantConfiguredAdminWithoutRBAC 0.93
TestTrueNASHandlers_HandleList_ReturnsMockConnectionsInMockMode 1.23
TestFreeBSDOfflineAgentPreflight 1.83
TestBranchcov0723AmExtractFromZip 8.86
TestHandleApplyUpdate_BlocksWhenReadinessBlocked 1.47
TestHandleGetUpdatePlan 1.65
TestHandleGetUpdatePlan_IncludesUpgradeReadiness 1.34
TestHandleGetUpdatePlan_InvalidChannel 1.09
TestHandleGetUpdatePlan_PrepareError 1.43
TestVMwareHandlers_HandleList_ReturnsMockConnectionsInMockMode 1.33
TestAlertsEndpoints 20.56
TestRecoveryRollupsEndpointToleratesMalformedPersistedMetadata 0.55
TestHealthEndpoint 19.04
TestVersionEndpointUsesRepoVersion 19.47
TestAlertAcknowledge_AllowsPrintableAlertIDs 18.81
TestStateEndpointReturnsMockData 20.72
TestRecoveryRollupsEndpointReturnsMockData 20.65
TestProtectedEndpointsRequireAuthentication 18.62
TestAPIOnlyModeRequiresToken 21.79
TestServerInfoEndpointReportsDevelopment 18.85
TestRecoveryPointsEndpointReturnsMockData 21.75
TestServerInfoEndpointMethodNotAllowed 18.65
TestHealthEndpointMethodNotAllowed 18.76
TestHealthEndpointHeadAllowed 18.68
TestConfigNodesUsesMockTopology 17.84
TestMockModeToggleEndpoint 25.43
TestMockModeToggleFromRealDataRebindsPlatformSupplementalProviders 19.24
TestAuthenticatedEndpointsRequireToken 19.40
TestAPITokenQueryAndHeaderAuth 23.11
TestRecoveryEndpointRequiresDirectLoopback 20.32
TestWebSocketSendsInitialState 19.38
TestWebsocketPayloadContractShape 17.62
TestWebsocketPayloadUsesCanonicalStateContract 19.56
TestSessionCookieAllowsAuthenticatedAccess 20.16
TestRevokedAPITokenImmediatelyLosesAccess 24.33
TestLimitedAPITokenCannotCreateBroaderToken 20.31
TestPublicURLDetectionUsesForwardedHeaders 17.31
TestPublicURLDetectionRespectsEnvOverride 19.14