# Run time in seconds of the slowest internal/api top-level tests under -race
# 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, the mean of the tests under 0.5s. A
# missing, stale or renamed entry can make the shards uneven but can never
# drop or repeat a test.
#
# Every api shard uploads an internal-api-test-seconds-N artifact with the
# seconds of each test it ran on the runner, so refresh this file from recent
# passing Build and Test runs with
#   python3 .github/scripts/refresh-internal-api-test-seconds.py --run <id> [--run <id>]
# when one api shard runs well over the others.
#
# Seeded 2026-09-29, before any such artifact existed, from a local
# GOMAXPROCS=4 go test -race -json run with each region of go test's order
# scaled so its sum matches the seconds the runner reported for it.
# Equal-count quarters (runs 36557693864, 36560070496, 36567708327,
# 36577491881) averaged 107s, 437s, 100s and 787s. The weighted cut (runs
# 36566872567, 36578019732) averaged 131s for the first 1187 tests, 350s for
# the next 23 and 608s for the last 21. Its 2556-test shard (887s, 875s) is
# left out, because it ran through -run . -skip, which recompiles the skip
# pattern for every test and subtest. The last quarter and the last 21 tests
# disagree on how the tail splits, so the two tail regions take the midpoint
# of an exact fit and one pooled factor.
DEFAULT_WEIGHT 0.05
TestActionRunnerRotationProductionRouterTLSPersistenceRestart 0.82
TestMockActionInboxAndDetailUseCanonicalResponses 2.85
TestMockActionInboxHonorsLimitAndLegacyPendingProjection 2.12
TestMockActionMutationsFailReadOnly 1.16
TestAgentReportHandlersClassifyBodyFailures 1.31
TestStart_MockModeStartsChatServiceWhenPersistedConfigDisabled 1.13
TestRestart_MockModeStartsChatServiceWhenPersistedConfigDisabled 1.13
TestHandleChat_EmitsIdleProgressWhileServiceIsSilent 2.85
TestAISettingsHandler_ProviderSettersConcurrentServiceCreation 9.86
TestHandleSaveGuestNote_VerifySavedFields 0.62
TestHandleClearGuestKnowledge_OversizedBody 0.68
TestHandlePatrolStream_LastEventIDHeaderTakesPrecedenceOverQueryFallback 2.37
TestHandleExecuteStream_LicenseRequired 1.25
TestHandleExecuteStream_PromptRequired 1.26
TestHandleExecuteStream_Success 2.13
TestHandleExecuteStream_EmitsIdleProgressWhileServiceIsSilent 2.06
TestHandleInvestigateAlert_EmitsIdleProgressWhileServiceIsSilent 2.01
TestAISettingsHandler_PatrolReadinessBranches 1.01
TestAISettingsHandler_KeylessOpenAICompatibleSetupIsConfiguredAndValidated 0.51
TestAISettingsHandler_TestProvider_ConnectionFailure 0.52
TestHandleGetAICostSummary_MethodNotAllowed 0.54
TestHandleInvestigateAlert_UsesVisibleIdleProgressStream 2.05
TestHandleGetPatterns_UnlockedWithData 1.23
TestHandleGetPredictions_WithData 1.23
TestHandleGetCorrelations_WithData 1.25
TestHandleGetCorrelations_UsesCanonicalIntelligenceFacade 1.24
TestExtractAndStoreAuthContext_UsesTenantConfigForToken 3.54
TestAuthDenialPruneKeepsTrackedSetBounded 2.28
TestAvailabilityHandlersListReturnsMockTargetsInMockMode 1.22
TestAvailabilityHandlersTestSavedMockTargetUsesSyntheticStatus 1.22
TestChangePasswordRefusesNonAdminSession 0.90
TestChangePasswordAllowsConfiguredAdminSession 1.66
TestChangePasswordBasicAuthPathUnaffected 4.57
TestChangePasswordFixtureOwnsRouterLifecycle 0.91
TestConfigTransferAnonymousAuthenticatedModesDenyBeforeBodyRead 0.55
TestConfigTransferAuthorizedInstanceModesReachHandler 0.77
TestConfigTransferTenantSessionsRequireManagement 0.54
TestConnectionsHandleListIncludesMockAvailabilityTargets 1.23
TestConnectionsHandleListDropsRealSourcesInMockMode 1.30
TestConnectionsLedgerKeepsRealSourcesWhenRealPollingRetained 1.26
TestContract_MockAvailabilityTargetsUseSavedTargetPayloads 1.23
TestContract_MockDiscoveryEndpointsUseCanonicalPayloads 1.15
TestContract_MockChartRoutesUseCanonicalMockUnifiedReadStateForVMwareHosts 324.29
TestContract_PlatformMockToggleRebindsRuntimeConnectionsAndResources 24.19
TestContract_PlatformMockConnectionListsUseSharedFixtureMetadata 1.31
TestContract_RecoveryPointsMockPathReturnsCanonicalProviderBackedFixtures 2.15
TestContract_SecurityStatusPresentationPolicyProEditionCommercialContext 0.67
TestContract_StateAndResourceListShareCanonicalMockResourceContract 6.16
TestContract_AgentCommandConfigGateMirrorsChannelAdmission 1.50
TestContract_HostedDiagnosticsDockerPrepareTokenValidatesOriginBeforeMutation 1.62
TestContract_HostedInstallerOriginsFailClosedAtRouter 5.36
TestContract_RuntimeDisplayServesPresentationValuesWithoutAdmin 1.11
TestSecurityStatusCurrentUserForScopedLocalSession 1.11
TestSecurityStatusOrgBoundSettingsFollowOrgManagementRule 1.11
TestSecurityStatusOrgBoundReportingRespectsAuthorizer 1.10
TestDiscoveryHandlers_MockModeServesFixturesWithoutService 1.50
TestDockerAgentReportSizeContractAcceptsOrdinaryAndLargeFleets 0.73
TestDockerAgentReportSizeContractBoundaries 3.42
TestHostAgentRemovalLifecycleThroughAuthenticatedRouterAndRestart 0.59
TestCollectorUninstallTransactionFailsClosedAndRetriesAfterRestart 2.85
TestHostedTenantAgentInstallCommand_GeneratesOrgBoundTokenAndCommand 4.15
TestGenerateHostedTenantAgentInstallCommandEnforcesHostedOrgBoundary 1.48
TestHostedTenantAgentInstallCommandCarriesCommandPolicyIntent 1.98
TestHostedTenantAgentInstallTokenCannotReportToOtherTenant 0.67
TestIssue1753SameNameProxmoxAgentsAuthenticateAndStayDistinctEndToEnd 1.73
TestSyncReleaseDemoFixtureRuntime_DoesNotPoliceMockFixturesInDevBuilds 0.96
TestMetricsHistoryFallbackSynthesizesUnseededMockWorkloadHistory 1.29
TestMetricsHistoryFallbackSynthesizesMockHostAndNodeDrawerSeries 1.57
TestMetricsHistoryFallbackSupplementsPartialMockStoreSeries 1.32
TestMetricsHistoryFallbackMockDiskSynthesizesSeries 1.30
TestMetricsHistoryFallbackMockUnifiedStorageSynthesizesSeries 1.79
TestMetricsHistoryFallbackMockStorageBypassesSparseStoreSeries 1.94
TestSSOOnlyExplicitAdminReachesEveryAdminGuard 1.11
TestUnrelatedSSOUserStillRefusedWhenLocalAdminConfigured 1.65
TestPlatformAdminRouteRefusesUnrelatedSSOUser 0.66
TestJourneyGeneralAPIBudgetIsolation 1.38
TestTenantRBACProvider_NoConnectionLeak 1.13
TestHandleListPointsAcceptsCanonicalPlatformQuery 1.43
TestHandleListRollupsExposeCanonicalPlatformsPayload 1.46
TestHandleListRollupsMetaReportsNormalizedPagination 2.13
TestHandleListPointsMetaReportsNormalizedPagination 2.15
TestStartPatrolForContext_DoesNotOverwriteOtherTenantPatrolComponents 1.81
TestStartPatrolForContext_RejectsMismatchedAIServiceOrg 0.98
TestRouterMockMode_SeedsTrueNASAndVMwareSupplementalResources 1.24
TestRouterMockMode_SeedsVMwareSupplementalActivity 0.95
TestRouteExecuteStream_Success 0.74
TestRouteExecuteStream_MethodNotAllowed 0.60
TestRouteExecuteStream_WrongScope 0.51
TestRouteExecuteStream_EmptyPrompt 0.65
TestRouteExecuteStream_WhitespaceOnlyPrompt 0.58
TestRouteExecuteStream_InvalidJSON 0.63
TestRouteExecuteStream_AIDisabled 0.61
TestRouteExecuteStream_AutofixLicenseRequired 0.59
TestRouteExecuteStream_RemediationLicenseRequired 0.52
TestRouteExecuteStream_OversizedBody 0.64
TestRouteExecuteStream_UseCaseCaseInsensitive 0.68
TestRouteExecuteStream_SSEHeaders 0.52
TestRouteExecuteStream_CompleteEventBeforeDone 0.60
TestRouteExecuteStream_EmptyBody 0.54
TestRouteExecuteStream_NullPrompt 0.58
TestRouteExecuteStream_ServiceError 0.55
TestRouteExecuteStream_InvalidHistoryRole 0.55
TestRouteExecuteStream_ValidTargetTypes 1.64
TestRouteExecuteStream_EmptyTargetTypeAllowed 1.18
TestRouteExecuteStream_WithTargetContext 0.59
TestRouteExecuteStream_DefaultUseCaseIsChat 0.58
TestRouteExecuteStream_FindingIDPassedThrough 0.58
TestRouteExecute_Success 0.58
TestRouteExecute_MethodNotAllowed 0.59
TestRouteExecute_NoAuth 0.62
TestRouteExecute_WrongScope 0.55
TestRouteExecute_EmptyPrompt 0.58
TestRouteExecute_InvalidJSON 0.59
TestRouteExecute_WithConversationHistory 0.54
TestRouteExecute_WithTargetContext 0.69
TestRouteExecute_DefaultUseCaseIsChat 0.58
TestRouteExecute_AutofixLicenseRequired 0.59
TestRouteExecute_OversizedBody 0.73
TestRouteExecute_EmptyBody 0.52
TestRouteExecute_EmptyJSONObject 0.74
TestRouteExecute_NullPrompt 0.59
TestRouteExecute_ServiceError 0.58
TestRouteExecute_InvalidTargetType 0.59
TestRouteExecute_ValidTargetTypes 1.70
TestRouteExecute_EmptyTargetTypeAllowed 0.59
TestRouteExecute_InvalidHistoryRole 0.58
TestRouteExecute_FindingIDPassedThrough 0.60
TestRouteExecute_ModelFieldPassedThrough 0.58
TestRouteListModels_Success 0.54
TestRouteListModels_MethodNotAllowed 0.52
TestRouteListModels_WrongScope 0.57
TestRouteListModels_ProviderError 0.59
TestRouteListModels_EmptyModelList 0.60
TestRouteListModels_CachedField 0.60
TestRouteListModels_MalformedProviderResponse 0.61
TestRouteListModels_HEADMethod 0.69
TestRouteTestConnection_Success 0.60
TestRouteTestConnection_MethodNotAllowed 0.57
TestRouteTestConnection_NoAuth 0.58
TestRouteTestConnection_WrongScope 0.58
TestRouteTestProvider_Success 0.57
TestRouteTestProvider_UnconfiguredProvider 0.52
TestRouteTestProvider_MethodNotAllowed 0.60
TestRouteTestProvider_NoAuth 0.59
TestRouteTestProvider_MultipleProviders 0.58
TestRouteTestProvider_WrongScope 0.59
TestRouteTestProvider_InvalidProviderNames 0.58
TestRouteTestProvider_PathTraversal 0.67
TestRouter_HandleState_MockIsolation 3.26
TestAITestConnectionRouteWithValidScope 0.72
TestAITestConnectionRouteRejectsWrongScope 0.79
TestAITestProviderRouteRejectsWrongScope 0.71
TestPublicEndpointsBypassAuthInAPIMode 0.59
TestSettingsCapabilitiesMatchRouteEnforcementWithoutRBAC 0.83
TestSettingsCapabilitiesGrantConfiguredAdminWithoutRBAC 0.90
TestTrueNASHandlers_HandleList_ReturnsMockConnectionsInMockMode 1.18
TestFreeBSDOfflineAgentPreflight 1.77
TestBranchcov0723AmExtractFromZip 8.53
TestHandleApplyUpdate_BlocksWhenReadinessBlocked 1.42
TestHandleGetUpdatePlan 1.59
TestHandleGetUpdatePlan_IncludesUpgradeReadiness 1.29
TestHandleGetUpdatePlan_InvalidChannel 1.05
TestHandleGetUpdatePlan_PrepareError 1.38
TestVMwareHandlers_HandleList_ReturnsMockConnectionsInMockMode 1.28
TestAlertsEndpoints 22.93
TestRecoveryRollupsEndpointToleratesMalformedPersistedMetadata 0.53
TestHealthEndpoint 21.24
TestVersionEndpointUsesRepoVersion 21.71
TestAlertAcknowledge_AllowsPrintableAlertIDs 20.98
TestStateEndpointReturnsMockData 23.11
TestRecoveryRollupsEndpointReturnsMockData 23.03
TestProtectedEndpointsRequireAuthentication 20.77
TestAPIOnlyModeRequiresToken 31.38
TestServerInfoEndpointReportsDevelopment 27.15
TestRecoveryPointsEndpointReturnsMockData 31.33
TestServerInfoEndpointMethodNotAllowed 26.85
TestHealthEndpointMethodNotAllowed 27.02
TestHealthEndpointHeadAllowed 26.90
TestConfigNodesUsesMockTopology 25.70
TestMockModeToggleEndpoint 36.62
TestMockModeToggleFromRealDataRebindsPlatformSupplementalProviders 27.70
TestAuthenticatedEndpointsRequireToken 27.94
TestAPITokenQueryAndHeaderAuth 33.28
TestRecoveryEndpointRequiresDirectLoopback 29.26
TestWebSocketSendsInitialState 27.92
TestWebsocketPayloadContractShape 25.38
TestWebsocketPayloadUsesCanonicalStateContract 28.16
TestSessionCookieAllowsAuthenticatedAccess 29.04
TestRevokedAPITokenImmediatelyLosesAccess 35.04
TestLimitedAPITokenCannotCreateBroaderToken 29.25
TestPublicURLDetectionUsesForwardedHeaders 24.93
TestPublicURLDetectionRespectsEnvOverride 27.56
