BackEnd\BuildManager\BuildManager.cs (16)
935Assumed.NotNull(configuration.Project, "Configuration should have been loaded.");
1067Assumed.Zero(_buildSubmissions.Count, "All submissions not yet complete.");
1068Assumed.Zero(_activeNodes.Count, "All nodes not yet shut down.");
1496Assumed.False(submission.IsCompleted, "Submission already complete.");
1535Assumed.NotNull(submission.BuildRequestData.ProjectInstance, "Unexpected null path for a submission with no ProjectInstance.");
1607Assumed.NotNull(resolvedConfiguration, "Cannot call project cache without having BuildRequestConfiguration");
1728Assumed.True(FileUtilities.IsSolutionFilename(config.ProjectFullPath), $"{config.ProjectFullPath} is not a solution");
1900Assumed.Unreachable($"Unexpected packet received by BuildManager: {packet.Type}");
2224Assumed.Null(submission.BuildResult?.Exception, "Exceptions only get set when the graph submission gets completed with an exception in OnThreadException. That should not happen during graph builds.");
2390Assumed.Equal(_buildManagerState, requiredState, $"Expected state {requiredState}, actual state {_buildManagerState}");
2738Assumed.True(_activeNodes.Contains(node), $"Unexpected shutdown from node {node} which shouldn't exist.");
2941Assumed.Unreachable($"Scheduling action {response.Action} not handled.");
3382Assumed.NotNull(castPacket, $"Incorrect packet type: {packet.Type} should have been {expectedType}");
3470Assumed.NotNull(inputCacheFiles);
3471Assumed.Null(_configCache, "caches must not be set at this point");
3472Assumed.Null(_resultsCache, "caches must not be set at this point");
BackEnd\BuildManager\LegacyThreadingData.cs (8)
58Assumed.True(_instanceForMainThread == null || (_instanceForMainThread != null && value == null) || (_instanceForMainThread == value), "Should not assign to instanceForMainThread twice without cleaning it");
91Assumed.False(_legacyThreadingEventsById.ContainsKey(submissionId), $"Submission {submissionId} should not already be registered with LegacyThreadingData");
107Assumed.True(_legacyThreadingEventsById.ContainsKey(submissionId), $"Submission {submissionId} should have been previously registered with LegacyThreadingData");
130Assumed.NotNull(legacyThreadingEvents, $"We're trying to wait on the legacy thread for submission {submissionId}, but that submission has not been registered.");
148Assumed.NotNull(legacyThreadingEvents, $"We're trying to track when the legacy thread for submission {submissionId} goes inactive, but that submission has not been registered.");
158Assumed.NotNull(instance?.RequestEntry?.Request, "Cannot signal legacy thread start for a RequestBuilder without a request");
169Assumed.NotNull(legacyThreadingEvents, $"We're trying to signal that the legacy thread is ready for submission {submissionId} to execute, but that submission has not been registered");
191Assumed.NotNull(legacyThreadingEvents, $"We're trying to signal that submission {submissionId} is done with the legacy thread, but that submission has not been registered");
BackEnd\Components\BuildRequestEngine\BuildRequestEngine.cs (21)
221Assumed.NotNull(_componentHost, "BuildRequestEngine not initialized by component host.");
222Assumed.Equal(_status, BuildRequestEngineStatus.Uninitialized, $"Engine must be in the Uninitiailzed state, but is {_status}");
252Assumed.True(_status is BuildRequestEngineStatus.Active or BuildRequestEngineStatus.Idle or BuildRequestEngineStatus.Waiting, $"Engine must be Active, Idle or Waiting to clean up, but is {_status}.");
254Assumed.NotNull(_nodeLoggingContext, "Node logging context not set.");
371Assumed.True(_status is not (BuildRequestEngineStatus.Shutdown or BuildRequestEngineStatus.Uninitialized), $"Engine loop not yet started, status is {_status}.");
374Assumed.False(_requestsByGlobalRequestId.ContainsKey(request.GlobalRequestId), $"Request {request.GlobalRequestId} is already known to the engine.");
375Assumed.True(_configCache.HasConfiguration(request.ConfigurationId), $"Request {request.GlobalRequestId} refers to configuration {request.ConfigurationId} which is not known to the engine.");
456Assumed.True(_status is not (BuildRequestEngineStatus.Shutdown or BuildRequestEngineStatus.Uninitialized), $"Engine loop not yet started, status is {_status}.");
457Assumed.True(_requestsByGlobalRequestId.ContainsKey(unblocker.BlockedRequestId), $"Request {unblocker.BlockedRequestId} is not known to the engine.");
561Assumed.True(_status is not (BuildRequestEngineStatus.Shutdown or BuildRequestEngineStatus.Uninitialized), $"Engine loop not yet started, status is {_status}.");
564Assumed.NotNull(_componentHost, "No host object set");
651Assumed.Null(_componentHost, "BuildRequestEngine already initialized!");
668Assumed.Equal(_status, BuildRequestEngineStatus.Uninitialized, $"Cleanup wasn't called, status is {_status}");
681Assumed.Equal(type, BuildComponentType.RequestEngine, $"Cannot create component of type {type}");
790Assumed.Null(activeEntry, "Multiple active requests");
816Assumed.Unreachable($"Unexpected BuildRequestEntry state {currentEntry.State}");
974Assumed.NotNull(_componentHost, "No host object set");
1174Assumed.NotNull(_componentHost, "No host object set");
1346Assumed.True((requestsToIssue == null) || (requestsToIssue.Count == 0), "Entry shouldn't be ready if we also issued requests.");
1400Assumed.True(config.WasGeneratedByNode, "InvalidConfigurationId");
1401Assumed.True(_unresolvedConfigurationsById.ContainsKey(config.ConfigurationId), "NoUnresolvedConfiguration");
BackEnd\Components\BuildRequestEngine\BuildRequestEntry.cs (20)
129Assumed.Equal(requestConfiguration.ConfigurationId, request.ConfigurationId, "Configuration id mismatch");
187Assumed.True(value == null || _requestBuilder == null, "Request Builder already set.");
204Assumed.True(configuration.WasGeneratedByNode, "Configuration has already been resolved.");
226Assumed.Equal(State, BuildRequestEntryState.Active, $"Must be in Active state to wait for blocking request. Config: {RequestConfiguration.ConfigurationId} State: {State}");
317Assumed.True(State == BuildRequestEntryState.Waiting || _outstandingRequests == null, $"Entry must be in the Waiting state to report results, or we must have flushed our requests due to an error. Config: {RequestConfiguration.ConfigurationId} State: {State} Requests: {_outstandingRequests != null}");
344Assumed.True(result.CircularDependency, "Received result for target in progress and it wasn't a circular dependency error.");
376Assumed.False(_outstandingResults.ContainsKey(result.NodeRequestId), "Request already contains results.");
395Assumed.Equal(State, BuildRequestEntryState.Waiting, $"Entry must be in the waiting state to be unblocked. Config: {RequestConfiguration.ConfigurationId} State: {State} Request: {Request.GlobalRequestId}");
396Assumed.NotEqual(_blockingGlobalRequestId, BuildRequest.InvalidGlobalRequestId, $"Entry must be waiting on another request to be unblocked. Config: {RequestConfiguration.ConfigurationId} Request: {Request.GlobalRequestId}");
413Assumed.Null(_unresolvedConfigurations, "All configurations must be resolved before Continue may be called.");
414Assumed.Null(_outstandingRequests, "All outstanding requests must have been satisfied.");
415Assumed.Equal(State, BuildRequestEntryState.Ready, $"Entry must be in the Ready state. Config: {RequestConfiguration.ConfigurationId} State: {State}");
485Assumed.Null(Result, "Entry already Completed.");
492Assumed.Equal(State, BuildRequestEntryState.Active, $"Entry must be active before it can be Completed successfully. Config: {RequestConfiguration.ConfigurationId} State: {State}");
493Assumed.Null(_unresolvedConfigurations, "Entry must not have any unresolved configurations.");
494Assumed.Null(_outstandingRequests, "Entry must have no outstanding requests.");
495Assumed.Null(_outstandingResults, "Results must be consumed before request may be completed.");
513Assumed.True(State is BuildRequestEntryState.Active or BuildRequestEntryState.Waiting, $"Must be in Active or Waiting state to wait for results. Config: {RequestConfiguration.ConfigurationId} State: {State}");
519Assumed.False(_outstandingRequests.ContainsKey(newRequest.NodeRequestId), $"Already waiting for local request {newRequest.NodeRequestId}");
524Assumed.True(addToIssueList, "Requests with unresolved configurations should always be added to the issue list.");
BackEnd\Components\Communications\NodeEndpointInProc.cs (17)
171Assumed.NotNull(factory);
189Assumed.NotNull(factory);
219Assumed.Equal(_status, LinkStatus.Active, $"Cannot send when link status is not active. Current status {_status}");
311Assumed.Equal(_status, LinkStatus.Active, $"Endpoint is not connected. Current status {_status}");
328Assumed.NotEqual(_status, newStatus, $"Attempting to change status to existing status {_status}.");
342Assumed.Equal(_mode, EndpointMode.Asynchronous, "EndPoint mode is synchronous, should be asynchronous");
343Assumed.NotNull(_packetQueue, "packetQueue is null");
344Assumed.NotNull(_packetAvailable, "packetAvailable is null");
357Assumed.Null(_packetPump, "packetPump != null");
358Assumed.Null(_packetAvailable, "packetAvailable != null");
359Assumed.Null(_terminatePacketPump, "terminatePacketPump != null");
360Assumed.Null(_packetQueue, "packetQueue != null");
394Assumed.NotNull(_packetPump, "packetPump == null");
395Assumed.NotNull(_packetAvailable, "packetAvailable == null");
396Assumed.NotNull(_terminatePacketPump, "terminatePacketPump == null");
397Assumed.NotNull(_packetQueue, "packetQueue == null");
453Assumed.Unreachable($"waitId {waitId} out of range.");
BackEnd\Components\Communications\NodeProviderOutOfProcTaskHost.cs (8)
209Assumed.True(_nodeContexts.TryGetValue(nodeKey, out NodeContext context), $"Invalid host context specified: {nodeKey}.");
378Assumed.Unreachable($"PacketReceived: no handler for node {node}, unexpected packet type {packet.Type}");
390Assumed.Equal(componentType, BuildComponentType.OutOfProcTaskHostNodeProvider, $"Factory cannot create components of type {componentType}");
419Assumed.True(Handshake.IsHandshakeOptionEnabled(hostContext, HandshakeOptions.TaskHost));
451Assumed.True(Handshake.IsHandshakeOptionEnabled(hostContext, HandshakeOptions.TaskHost));
485Assumed.False(isArm64, "ARM64 CLR2 task hosts are not supported.");
515Assumed.True(Handshake.IsHandshakeOptionEnabled(hostContext, HandshakeOptions.TaskHost));
715Assumed.False(_nodeContexts.ContainsKey(nodeKey), "We should not already have a node for this context! Did we forget to call DisconnectFromHost somewhere?");
BackEnd\Components\Logging\LoggingService.cs (19)
894Assumed.NotEqual(_serviceState, LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
895Assumed.NotNull(buildComponentHost, "BuildComponentHost was null");
933Assumed.NotEqual(_serviceState, LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
1003Assumed.NotNull(packet, "packet was null");
1006Assumed.Equal(packet.Type, NodePacketType.LogMessage, $"""Expected packet type "{nameof(NodePacketType.LogMessage)}" but instead got packet type "{packet.Type}".""");
1011Assumed.NotEqual(loggingPacket.EventType, LoggingEventType.CustomEvent, "Custom event types are no longer supported. Does the sending node have a different version?");
1028Assumed.NotEqual(_serviceState, LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
1029Assumed.NotNull(logger, "logger was null");
1117Assumed.NotEqual(_serviceState, LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
1118Assumed.NotNull(forwardingLogger, "forwardingLogger was null");
1184Assumed.NotEqual(_serviceState, LoggingServiceState.Shutdown, " The object is shutdown, should not do any operations on a shutdown component");
1185Assumed.NotNull(forwardingLoggerSink, "forwardingLoggerSink was null");
1186Assumed.NotNull(descriptions, "loggerDescriptions was null");
1187Assumed.Positive(descriptions.Count, "loggerDescriptions was null");
1239Assumed.NotNull(buildEvent, "buildEvent is null");
1301Assumed.NotNull(buildEvent, "buildEvent is null");
1373Assumed.True(_configCache.Value.HasConfiguration(projectStartedEventArgs.ProjectId), "Cannot find the project configuration while injecting non-serialized data from out-of-proc node.");
1596Assumed.NotNull(buildEventArgs, $"Unknown logging item in queue: {loggingEvent.GetType().FullName}");
1981Assumed.True(projectFile != null || allowCacheMiss, $"ContextID {context.ProjectContextId} should have been in the ID-to-project file mapping but wasn't! Encountered during logging message: '{eventArgs.Message}'");
BackEnd\Components\Logging\LoggingServiceLogMethods.cs (31)
42Assumed.NotNullOrEmpty(messageResourceName, "Need resource string for comment message.");
114Assumed.NotNullOrEmpty(messageResourceName, "Need resource string for error message.");
139Assumed.NotNull(projectFile, $"ContextID {buildEventContext.ProjectContextId} should have been in the ID-to-project file mapping but wasn't!");
157Assumed.NotNull(invalidProjectFileException, "Need exception context.");
158Assumed.NotNull(buildEventContext, "buildEventContext is null");
179Assumed.NotNull(projectFile, $"ContextID {buildEventContext.ProjectContextId} should have been in the ID-to-project file mapping but wasn't!");
211Assumed.NotNull(taskName, "Must specify the name of the task that failed.");
228Assumed.NotNullOrEmpty(messageResourceName, "Need resource string for error message.");
262Assumed.NotNullOrEmpty(taskName, "Must specify the name of the task that failed.");
287Assumed.NotNullOrEmpty(messageResourceName, "Need resource string for warning message.");
304Assumed.NotNull(file, "Must specify the associated file.");
305Assumed.NotNull(message, "Need warning message.");
306Assumed.NotNull(buildEventContext, "Need a BuildEventContext");
331Assumed.NotNull(projectFile, $"ContextID {buildEventContext.ProjectContextId} should have been in the ID-to-project file mapping but wasn't!");
525Assumed.NotNull(projectEvaluationEventContext, "projectBuildEventContext");
601Assumed.NotNull(nodeBuildEventContext, "Need a nodeBuildEventContext");
607Assumed.False(_projectFileMap.ContainsKey(projectContextId), $"ContextID {projectContextId} for project {projectFile} should not already be in the ID-to-file mapping!");
616Assumed.Equal(
627Assumed.NotEqual(
638Assumed.NotNull(parentBuildEventContext, "Need a parentBuildEventContext");
640Assumed.True(_configCache.Value.HasConfiguration(configurationId), "Cannot find the project configuration while injecting non-serialized data from out-of-proc node.");
672Assumed.NotNull(projectBuildEventContext, "projectBuildEventContext");
686Assumed.True(_projectFileMap.TryRemove(projectBuildEventContext.ProjectContextId, out _), $"ContextID {projectBuildEventContext.ProjectContextId} for project {projectFile} should be in the ID-to-file mapping!");
703Assumed.NotNull(projectBuildEventContext, "projectBuildEventContext is null");
744Assumed.NotNull(targetBuildEventContext, "targetBuildEventContext is null");
771Assumed.NotNull(taskBuildEventContext, "targetBuildEventContext is null");
800Assumed.NotNull(targetBuildEventContext, "targetBuildEventContext is null");
840Assumed.NotNull(taskBuildEventContext, "taskBuildEventContext is null");
866Assumed.NotNull(eventName, "eventName is null");
888Assumed.NotNull(buildEventContext, "buildEventContext was null");
889Assumed.NotNull(filePath, "response file path was null");
BackEnd\Components\RequestBuilder\Lookup.cs (13)
104Assumed.NotNull(projectItems);
105Assumed.NotNull(properties);
265Assumed.GreaterThanOrEqual(_lookupScopes.Count, 2, "Too many calls to Leave().");
266Assumed.True(Object.ReferenceEquals(scopeToLeave, _lookupScopes), $"Attempting to leave with scope '{scopeToLeave.Description}' but scope '{_lookupScopes.Description}' is on top of the stack.");
453Assumed.NotNullOrEmpty(name);
682Assumed.Null(existing, "Cannot add an itemgroup of this type.");
709Assumed.Null(_lookupScopes.ItemTypesToTruncateAtThisScope, "Cannot add an itemgroup of this type.");
918Assumed.False(_cloneTable.ContainsKey(cloneItem), "Should be new, not already in table!");
1049Assumed.False(tableOfItemsOfSameType.Contains(item), "Item should not be in table");
1064Assumed.False(tableOfItemsOfSameType.ContainsKey(item), "Item should not be in table");
1095Assumed.NotNull(_lookupScopes.Parent, "Operation in outer scope not supported");
1270Assumed.NotNull(value);
1328Assumed.NotEqual(modificationType, ModificationType.Update, "Modification type may only be update when a value is specified.");
BackEnd\Components\RequestBuilder\RequestBuilder.cs (34)
204Assumed.NotNull(_componentHost, "Host not set.");
205Assumed.Null(_targetBuilder, "targetBuilder not null");
206Assumed.Null(_nodeLoggingContext, "nodeLoggingContext not null");
207Assumed.Null(_requestEntry, "requestEntry not null");
208Assumed.False(_terminateEvent.WaitOne(0), "Cancel already called");
228Assumed.True(HasActiveBuildRequest, "Request not building");
229Assumed.False(_terminateEvent.WaitOne(0), "Request already terminated");
230Assumed.False(_continueEvent.WaitOne(0), "Request already continued");
234Assumed.True(_blockType == BlockType.BlockedOnTargetInProgress || _blockType == BlockType.Yielded || (_continueResults != null), $"Unexpected null results for request {_requestEntry.Request.GlobalRequestId} (nr {_requestEntry.Request.NodeRequestId})");
245Assumed.True(HasActiveBuildRequest, "Request not building");
246Assumed.False(_terminateEvent.WaitOne(0), "Request already terminated");
247Assumed.False(_pendingResourceRequests.IsEmpty, "No pending resource requests");
342Assumed.NotNull(_componentHost, "No host object set");
343Assumed.Equal(projectFiles.Length, properties.Length, "Properties and project counts not the same");
344Assumed.Equal(projectFiles.Length, toolsVersions.Length, "Tools versions and project counts not the same");
388Assumed.Equal(requests.Length, results.Length, "# results != # requests");
478Assumed.False(_inMSBuildCallback, "Already in an MSBuild callback!");
488Assumed.True(_inMSBuildCallback, "Not in an MSBuild callback!");
497Assumed.True(Monitor.IsEntered(monitorLockObject), "Not running under the given lock");
558Assumed.Null(_componentHost, "RequestBuilder already initialized.");
634Assumed.Equal(type, BuildComponentType.RequestBuilder, $"Cannot create components of type {type}");
643Assumed.Null(_requestTask, "Already have a task.");
685Assumed.NotEqual(_componentHost.LegacyThreadingData.MainThreadSubmissionId, _requestEntry.Request.SubmissionId, "Can't start builder thread when we are using legacy threading semantics for this request.");
750Assumed.Equal(_requestEntry.State, BuildRequestEntryState.Ready, $"Entry is not in the Ready state, it is in the {_requestEntry.State} state.");
758Assumed.Equal(_requestEntry.State, BuildRequestEntryState.Active, $"Entry is not in the Active state, it is in the {_requestEntry.State} state.");
766Assumed.True(_requestEntry.State is BuildRequestEntryState.Active or BuildRequestEntryState.Waiting, $"Entry is not in the Active or Waiting state, it is in the {_requestEntry.State} state.");
868Assumed.Null(result, "Result already set when exception was thrown.");
1004Assumed.Equal(requests.Length, results.Length, "# results != # requests");
1022Assumed.False(isContinue, "Unexpected null results during continue");
1132Assumed.NotNull(_targetBuilder, "Target builder is null");
1241Assumed.Equal(_requestEntry.RequestConfiguration.ResultsNodeId, _componentHost.BuildParameters.NodeId, $"Results for configuration {_requestEntry.RequestConfiguration.ConfigurationId} were not retrieved from node {_requestEntry.RequestConfiguration.ResultsNodeId}");
1451Assumed.NotNull(_requestEntry.RequestConfiguration.SavedCurrentDirectory, "Current directory not previously saved.");
1452Assumed.NotNull(_requestEntry.RequestConfiguration.SavedEnvironmentVariables, "Current environment not previously saved.");
1476Assumed.False(_isZombie, "RequestBuilder has been zombied.");
BackEnd\Components\RequestBuilder\TargetEntry.cs (8)
422Assumed.False(_isExecuting, $"Target {_target.Name} is already executing");
700Assumed.Null(_legacyCallTargetScopes, "We should have already left any legacy call target scopes.");
747Assumed.Null(_legacyCallTargetScopes, "We should have already left any legacy call target scopes.");
772Assumed.NotEqual(_state, TargetEntryState.Completed, $"State must not be Completed. State is {_state}.");
783Assumed.Equal(_state, TargetEntryState.Completed, $"State must be Completed. State is {_state}.");
784Assumed.Equal(_targetResult.ResultCode, TargetResultCode.Skipped, $"ResultCode must be Skipped. ResultCode is {_targetResult.ResultCode}.");
785Assumed.Equal(_targetResult.WorkUnitResult.ActionCode, WorkUnitActionCode.Continue, $"ActionCode must be Continue. ActionCode is {_targetResult.WorkUnitResult.ActionCode}.");
889Assumed.Equal(actual, expected, $"Expected state {expected}. Got {actual}");
BackEnd\Components\RequestBuilder\TargetUpToDateChecker.cs (19)
58Assumed.NotNull(project, "Need a project.");
59Assumed.NotNull(targetToAnalyze, "Need a target to analyze.");
93Assumed.NotNull(_targetInputSpecification, "targetInputSpecification is null");
106Assumed.NotNull(_targetOutputSpecification, "targetOutputSpecification is null");
205Assumed.Positive(itemVectorsReferencedInBothTargetInputsAndOutputs.Count, "The target must have inputs.");
206Assumed.False(IsItemVectorEmpty(itemVectorsInTargetInputs), "The target must have inputs.");
610Assumed.Equal(inputItemVectors.Count, 1, "There should only be one item vector of a particular type in the target inputs that can be filtered.");
713Assumed.LessThanOrEqual(numberOfInputItemVectorsWithAllChangedItems, itemVectorsReferencedInBothTargetInputsAndOutputs.Count, "The number of vectors containing all changed items cannot exceed the number of correlated vectors.");
718Assumed.Equal(result, DependencyAnalysisResult.IncrementalBuild, "If inputs have changed, this must be an incremental build.");
846Assumed.False(itemVectorPartition.ContainsKey(item), $"ItemVectorPartition already contains a vector for items with the expression '{item}'");
849Assumed.True((itemVectorTransforms == null) || (itemVectorCollection.Equals(itemVectorTransforms)) || (itemVectorPartition.Count == 1), "If transforms have been separated out, there should only be one item vector per partition.");
959Assumed.Positive(inputs.Count, "Need to specify inputs.");
960Assumed.Positive(outputs.Count, "Need to specify outputs.");
963Assumed.True(inputs[0] is string or ProjectItemInstance, "Must be either string or ProjectItemInstance");
968Assumed.True(outputs[0] is string or ProjectItemInstance, "Must be either string or ProjectItemInstance");
1083Assumed.True(inputs[0] is string or ProjectItemInstance, "Must be either string or ProjectItemInstance");
1088Assumed.True(outputs[0] is string or ProjectItemInstance, "Must be either string or ProjectItemInstance");
1196Assumed.NotNullOrEmpty(path1);
1197Assumed.NotNullOrEmpty(path2);
BackEnd\Components\RequestBuilder\TaskBuilder.cs (8)
155Assumed.NotNull(taskInstance, "Need to specify the task instance.");
226Assumed.NotNull(_taskExecutionHost, "taskExecutionHost not initialized.");
243Assumed.Equal(type, BuildComponentType.TaskBuilder, $"Cannot create components of type {type}");
527Assumed.Equal(howToExecuteTask, TaskExecutionMode.InferOutputsOnly, "should be inferring");
529Assumed.True(GatherTaskOutputs(null, howToExecuteTask, bucket), "The method GatherTaskOutputs() should never fail when inferring task outputs.");
555Assumed.NotNull(_taskNode); // taskNode should never be null when we're calling this method.
978Assumed.Unreachable();
1187Assumed.Equal(howToExecuteTask, TaskExecutionMode.InferOutputsOnly, "should be inferring");
BackEnd\Components\RequestBuilder\TaskHost.cs (8)
121Assumed.NotNull(taskLocation);
301Assumed.Equal(targetOutputsPerProject.Length, result.TargetOutputsPerProject.Count, $"{targetOutputsPerProject.Length} != {result.TargetOutputsPerProject.Count}");
361Assumed.Equal(_yieldThreadId, -1, "Cannot call Yield() while yielding.");
390Assumed.NotEqual(_yieldThreadId, -1, "Cannot call Reacquire() before Yield().");
391Assumed.Equal(_yieldThreadId, Environment.CurrentManagedThreadId, $"Cannot call Reacquire() on thread {Environment.CurrentManagedThreadId} when Yield() was called on thread {_yieldThreadId}");
1218Assumed.Equal(results.Length, projectFileNames.Length, $"{results.Length}!={projectFileNames.Length}.");
1263Assumed.True(results.Length == projectFileNames.Length || !overallSuccess, $"The number of results returned {results.Length} cannot be less than the number of project files {projectFileNames.Length} unless one of the results indicated failure.");
1278Assumed.True(_activeProxy, "Attempted to use an inactive task host.");
BackEnd\Components\Scheduler\SchedulableRequest.cs (18)
130Assumed.True((parent == null) || (parent._schedulingData == collection), "Parent request does not belong to the same collection.");
255Assumed.Equal(_creationTime, DateTime.MinValue, "Cannot set CreationTime twice.");
272Assumed.Equal(_startTime, DateTime.MinValue, "Cannot set StartTime twice.");
289Assumed.Equal(_endTime, DateTime.MinValue, "Cannot set EndTime twice.");
339Assumed.Null(BlockingTarget, "Cannot block again if we're already blocked on a target");
344Assumed.False(_requestsWeAreBlockedBy.ContainsKey(key), "We are already blocked by this request.");
345Assumed.False(blockingRequest._requestsWeAreBlocking.Contains(this), "The blocking request thinks it is already blocking us.");
400Assumed.True(_assignedNodeId == Scheduler.InvalidNodeId || _assignedNodeId == nodeId, "Request must always resume on the same node on which it was started.");
403Assumed.True((_state == SchedulableRequestState.Ready) || !_schedulingData.IsRequestScheduled(this), $"Another instance of request {_request.GlobalRequestId} is already scheduled.");
404Assumed.False(_schedulingData.IsNodeWorking(nodeId), $"Cannot resume execution of request {_request.GlobalRequestId} because node {nodeId} is already working.");
407Assumed.True(requiredNodeId == Scheduler.InvalidNodeId || requiredNodeId == nodeId, $"Request {_request.GlobalRequestId} cannot be assigned to node {nodeId} because its configuration is already assigned to node {requiredNodeId}");
419Assumed.True(_state != SchedulableRequestState.Ready || result.CircularDependency, "Request can only be Completed from the Ready state if the result indicates a circular dependency occurred.");
420Assumed.Zero(_requestsWeAreBlockedBy.Count, "We can't be complete if we are still blocked on requests.");
438Assumed.Zero(_requestsWeAreBlockedBy.Count, "We are blocked by requests.");
439Assumed.Zero(_requestsWeAreBlocking.Count, "We are blocking by requests.");
448Assumed.Equal(_state, requiredState, $"Request {_request.GlobalRequestId} expected to be in state {requiredState} but state is actually {_state}");
640Assumed.True(_requestsWeAreBlockedBy.TryGetValue(blockingRequestKey, out SchedulableRequest unblockingRequest), "We are not blocked by the specified request.");
641Assumed.True(unblockingRequest._requestsWeAreBlocking.Contains(this), "The request unblocking us doesn't think it is blocking us.");
BackEnd\Components\Scheduler\Scheduler.cs (23)
374Assumed.True(string.IsNullOrEmpty(blocker.BlockingTarget), "Blocking target should be null because this is not a request blocking on a target");
379Assumed.True(string.IsNullOrEmpty(blocker.BlockingTarget), "Blocking target should be null because this is not a request blocking on a target");
388Assumed.NotNullOrEmpty(blocker.BlockingTarget, "Blocking target should exist");
400Assumed.True(string.IsNullOrEmpty(blocker.BlockingTarget), "Blocking target should be null because this is not a request blocking on a target");
446Assumed.Equal(result.ParentGlobalRequestId, request.Parent.BuildRequest.GlobalRequestId, "Result's parent doesn't match request's parent.");
564Assumed.Unreachable();
710Assumed.Equal(componentType, BuildComponentType.Scheduler, $"Cannot create components of type {componentType}");
817Assumed.Unreachable($"Somehow no requests are currently executing, and at least one of the {_schedulingData.BlockedRequestsCount} requests blocked by in-progress requests is servicable by a currently existing node, but no circular dependency was detected ...");
824Assumed.Unreachable($"None of the {_schedulingData.BlockedRequestsCount} blocked requests can be serviced by currently existing nodes, but we aren't requesting a new one.");
830Assumed.Unreachable($"Somehow we have {_schedulingData.ReadyRequestsCount} requests which are ready to go but we didn't tell the nodes to continue.");
835Assumed.Unreachable($"Somehow we have {_schedulingData.UnscheduledRequestsCount} unassigned build requests but {idleNodes.Count} of our nodes are free and we aren't requesting a new one...");
840Assumed.Positive(responses.Count, "We failed to request a node to be created.");
1426Assumed.NotEqual(nodeId, InvalidNodeId, "Invalid node id specified.");
1441Assumed.NotEqual(config.ResultsNodeId, InvalidNodeId, "Configuration's results node is not set.");
1454Assumed.True(_componentHost.BuildParameters.DisableInProcNode || ForceAffinityOutOfProc, "Proxy requests should only get scheduled to out of proc nodes when the inproc node is disabled");
1608Assumed.Unreachable();
1630Assumed.Equal(inProcNodesToCreate, 1, "We should not be trying to create more than one inproc node");
1835Assumed.True(_configCache.HasConfiguration(request.ConfigurationId), "A request should have a configuration if it makes it this far in the build process.");
1922Assumed.Null(request.Parent, "Unexpectedly generated a SubmissionComplete response for a request which is not top-level.");
2121Assumed.True(configCache.HasConfiguration(configurationId), "All non root requests should have a parent with a loaded configuration");
2194Assumed.NotEqual(parentRequestNode, InvalidNodeId, "Invalid parent node provided.");
2197Assumed.Equal(result.ParentGlobalRequestId, requestWhichGeneratedResult.ParentGlobalRequestId, "Result's parent doesn't match request's parent.");
2252Assumed.NotEqual(request.ConfigurationId, BuildRequestConfiguration.InvalidConfigurationId, "Requests should have a valid configuration id at this point");
BackEnd\Components\Scheduler\SchedulingData.cs (14)
280Assumed.True(_buildHierarchy.ContainsKey(parent), $"Parent doesn't exist in build hierarchy for request {request.BuildRequest.GlobalRequestId}");
332Assumed.False(requestsAssignedToNode.Contains(request), $"Request {request.BuildRequest.GlobalRequestId} is already scheduled to node {request.AssignedNode}");
356Assumed.False(_blockedRequests.ContainsKey(request.BuildRequest.GlobalRequestId), $"Request with global id {request.BuildRequest.GlobalRequestId} is already blocked!");
361Assumed.False(_yieldingRequests.ContainsKey(request.BuildRequest.GlobalRequestId), $"Request with global id {request.BuildRequest.GlobalRequestId} is already yielded!");
366Assumed.True(_configurationToRequests.ContainsKey(request.BuildRequest.ConfigurationId), $"Configuration {request.BuildRequest.ConfigurationId} never had requests assigned to it.");
367Assumed.Positive(_configurationToRequests[request.BuildRequest.ConfigurationId].Count, $"Configuration {request.BuildRequest.ConfigurationId} has no requests assigned to it.");
378Assumed.False(_executingRequests.ContainsKey(request.BuildRequest.GlobalRequestId), $"Request with global id {request.BuildRequest.GlobalRequestId} is already executing!");
379Assumed.True(!_executingRequestByNode.ContainsKey(request.AssignedNode) || _executingRequestByNode[request.AssignedNode] == null, $"Node {request.AssignedNode} is currently executing a request.");
392Assumed.False(_readyRequests.ContainsKey(request.BuildRequest.GlobalRequestId), $"Request with global id {request.BuildRequest.GlobalRequestId} is already ready!");
401Assumed.False(readyRequestsOnNode.Contains(request), $"Request with global id {request.BuildRequest.GlobalRequestId} is already marked as ready on node {request.AssignedNode}");
406Assumed.Unreachable($"Request with global id {request.BuildRequest.GlobalRequestId} cannot transition to the Unscheduled state");
491Assumed.NotNull(returnValue, $"Global Request Id {globalRequestId} has not been assigned and cannot be retrieved.");
682Assumed.Zero(GetRequestsAssignedToConfigurationCount(configurationId), $"Configuration with ID {configurationId} cannot be unassigned from a node, because there are requests scheduled with that configuration.");
723Assumed.NotNull(request, $"Request {globalRequestId} was expected to be in state {state} but is not scheduled at all (it may be unscheduled or may be unknown to the system.)");
BackEnd\Shared\BuildRequestConfiguration.cs (20)
178Assumed.NotNullOrEmpty(data.ProjectFullPath);
241Assumed.NotEqual(configId, InvalidConfigurationId, "Configuration ID must not be invalid when using this constructor.");
243Assumed.Null(other._transferredState, "Unexpected transferred state still set on other configuration.");
372Assumed.True((_configId == InvalidConfigurationId) || (WasGeneratedByNode && (value > InvalidConfigurationId)), $"Configuration ID must be invalid, or it must be less than invalid and the new config must be greater than invalid. It was {_configId}, the new value was {value}.");
403Assumed.False(IsCached, "We shouldn't be accessing the ProjectInstance when the configuration is cached.");
415Assumed.Null(_transferredProperties, "Shouldn't be transferring entire state of ProjectInstance when transferredProperties is not null.");
435Assumed.NotNull(project, "Cannot set null project.");
465Assumed.False(IsLoaded, $"Already loaded the project for this configuration id {ConfigurationId}.");
542Assumed.True(IsLoaded, $"This {nameof(BuildRequestConfiguration)} must be loaded at the end of this method");
569Assumed.Null(_projectInitialTargets, "Initial targets cannot be reset once they have been set.");
585Assumed.Null(_projectDefaultTargets, "Default targets cannot be reset once they have been set.");
600Assumed.Null(_projectTargets, "Targets cannot be reset once set.");
617Assumed.False(IsCached, "Configuration is cached, we shouldn't be accessing the lookup.");
794Assumed.Equal(request.ConfigurationId, ConfigurationId, "Request does not match configuration.");
795Assumed.NotNull(_projectInitialTargets, "Initial targets have not been set.");
796Assumed.NotNull(_projectDefaultTargets, "Default targets have not been set.");
800Assumed.True(CollectionHelpers.SetEquivalent(request.Targets, request.ProxyTargets.ProxyTargetToRealTargetMap.Keys), "Targets must be same as proxy targets");
836Assumed.NotNull(Project);
837Assumed.NotNullOrEmpty(referenceFullPath);
838Assumed.True(Path.IsPathRooted(referenceFullPath), "Method does not treat path normalization cases");
Construction\ProjectElementContainer.cs (15)
176Assumed.Equal(child.NextSibling.PreviousSibling, reference, "Invalid structure");
232Assumed.Equal(child.PreviousSibling.NextSibling, reference, "Invalid structure");
256Assumed.NotNull(FirstChild, "Invalid structure");
275Assumed.NotNull(LastChild, "Invalid structure");
389Assumed.Equal(child.Parent, this, "Expected parent already set");
390Assumed.True(child.PreviousSibling == null && child.NextSibling == null, "Invalid structure");
391Assumed.Null(Link, "Attempt to edit a document that is not backed by a local xml is disallowed.");
441Assumed.Null(Link, "Attempt to edit a document that is not backed by a local xml is disallowed.");
458Assumed.Null(Link, "Attempt to edit a document that is not backed by a local xml is disallowed.");
474Assumed.Null(Link, "Attempt to edit a document that is not backed by a local xml is disallowed.");
494Assumed.Null(Link, "Attempt to edit a document that is not backed by a local xml is disallowed.");
609Assumed.Null(Link, "Attempt to edit a document that is not backed by a local xml is disallowed.");
651Assumed.True(FirstChild == null && LastChild == null, "Expecting no children");
692Assumed.True(child.NextSibling == null || child.NextSibling.PreviousSibling != this, "Invalid structure");
693Assumed.True(child.PreviousSibling == null || child.PreviousSibling.NextSibling != this, "Invalid structure");
Definition\Project.cs (14)
1803Assumed.False(implementationInternal.IsZombified, "OM_ProjectIsNoLongerActive");
1814Assumed.NotNull(otherXml);
2453_ => Assumed.Unreachable<bool>(),
2849Assumed.Unreachable();
3566Assumed.Null(_data.Expander.Metadata, "Should be null");
3593Assumed.NotNull(otherXml);
3745Assumed.NotEqual(LastEvaluationId, BuildEventContext.InvalidEvaluationId, "Evaluation should produce an evaluation ID");
3766Assumed.False(IsDirty, "Should not be dirty now");
3813Assumed.Equal(LastEvaluationId, BuildEventContext.InvalidEvaluationId, "This is the first evaluation therefore the last evaluation id is invalid");
3817Assumed.NotEqual(LastEvaluationId, BuildEventContext.InvalidEvaluationId, "Last evaluation ID must be valid after the first evaluation");
4402Assumed.NotNull(property);
4414Assumed.NotNull(itemDefinitionMetadatum);
4426Assumed.NotNull(item);
4570=> Assumed.Unreachable<bool>();
ElementLocation\ElementLocation.cs (7)
143Assumed.Equal(translator.Mode, TranslationDirection.WriteToStream, "write only");
255Assumed.PositiveOrZero(line, "Use zero for unknown");
256Assumed.PositiveOrZero(column, "Use zero for unknown");
331Assumed.PositiveOrZero(line, "Use zero for unknown");
332Assumed.PositiveOrZero(column, "Use zero for unknown");
333Assumed.LessThanOrEqual(line, 65535, "Use ElementLocation instead");
334Assumed.LessThanOrEqual(column, 65535, "Use ElementLocation instead");
Evaluation\Expander.cs (15)
499Assumed.NotNull(elementLocation);
520Assumed.NotNull(elementLocation);
534Assumed.True((options & ExpanderOptions.BreakOnNotEmpty) == 0, "not supported");
568Assumed.NotNull(elementLocation);
642Assumed.NotNull(elementLocation);
983Assumed.NotNull(metadata, "Cannot expand metadata without providing metadata");
1153Assumed.NotEqual(options, ExpanderOptions.Invalid, "Must be expanding metadata of some kind");
1161Assumed.True(itemMetadataMatch.Success, "Need a valid item metadata.");
1285Assumed.NotNull(properties, "Cannot expand properties without providing properties");
2122Assumed.False(matchesEnumerator.MoveNext(), "Expected just one item vector");
2133Assumed.NotNull(items, "Cannot expand items without providing items");
2251Assumed.NotNull(evaluatedItems, "Cannot expand items without providing items");
2334Assumed.NotNull(items, "Cannot expand items without providing items");
4309Assumed.True(cachedTypeInformation.Item1 != null || cachedTypeInformation.Item2 != null, "Function type information needs either string or type represented.");
4327Assumed.NotNull(receiverType, $"Type information for {typeName} was present in the allowlist cache as {assemblyQualifiedTypeName} but the type could not be loaded.");
Graph\GraphBuilder.cs (5)
231Assumed.True(projectsByPath.TryGetValue(referencingProjectPath, out var referencingNodes), "nodes should include solution projects");
236Assumed.True(projectsByPath.TryGetValue(referencedProjectPath, out List<ProjectGraphNode> projectToReturn), "nodes should include solution projects");
463Assumed.Equal(state, NodeVisitationState.Processed, "entrypoints should get processed after a call to detect cycles");
701Assumed.True(ReferenceItems.TryGetValue(key, out ProjectItemInstance referenceItem), "All requested keys should exist");
746Assumed.True(ReferenceItems.TryRemove(key, out _), "All requested keys should exist");
Instance\ProjectInstance.cs (18)
378Assumed.NotNull(project);
431Assumed.NotNull(linkedProject);
675Assumed.NotNull(data);
676Assumed.NotNullOrEmpty(directory);
741Assumed.True(filter == null || isImmutable, "The result of a filtered ProjectInstance clone must be immutable.");
1555=> Assumed.Unreachable<Dictionary<string, List<string>>>();
1811=> Assumed.Unreachable();
1836=> Assumed.Unreachable();
1848=> Assumed.Unreachable();
1860=> Assumed.Unreachable();
2441Assumed.Null(ProjectRootElementCache, $"{nameof(ProjectRootElementCache)} is already set. Cannot set again");
2442Assumed.Null(_hostServices, $"{nameof(HostServices)} is already set. Cannot set again");
2443Assumed.NotNull(TaskRegistry, $"{nameof(TaskRegistry)} Cannot be null after {nameof(ProjectInstance)} object creation.");
2639Assumed.True(FileUtilities.IsSolutionFilename(projectFile), $"Project file {projectFile} is not a solution.");
2916Assumed.NotNullOrEmpty(targetName);
2917Assumed.False(_actualTargets.ContainsKey(targetName), $"Target {targetName} already exists.");
3272Assumed.Equal(EvaluationId, BuildEventContext.InvalidEvaluationId, "Evaluation ID is invalid prior to evaluation");
3295Assumed.NotEqual(EvaluationId, BuildEventContext.InvalidEvaluationId, "Evaluation should produce an evaluation ID");