コード例 #1
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.Result == TaskResult.Failed
                              where r.RecordType == "Task"
                              where r.Task != null
                              where r.Task.Name == "Cache"
                              where r.Log != null
                              select r;

            var classificationFound = false;

            foreach (var failedTask in failedTasks)
            {
                foreach (var classifier in failureClassifiers)
                {
                    if (failedTask.Issues.Any(i => classifier.IsFailure(i.Message)))
                    {
                        context.AddFailure(failedTask, classifier.FailureName);
                        classificationFound = true;
                    }
                }

                if (!classificationFound)
                {
                    context.AddFailure(failedTask, "Cache Failure Other");
                }
            }
        }
コード例 #2
0
        public async Task <IEnumerable <Failure> > AnalyzeFailureAsync(Build build, Timeline timeline)
        {
            var failures = new List <Failure>();

            var context = new FailureAnalyzerContext(build, timeline, failures);

            foreach (var classifier in classifiers)
            {
                await classifier.ClassifyAsync(context);
            }

            if (failures.Count == 0)
            {
                if (build.Result != BuildResult.Succeeded &&
                    build.Result != BuildResult.Canceled)
                {
                    foreach (var record in timeline.Records.Where(x => x.ParentId.HasValue == false))
                    {
                        if (record.Result == TaskResult.Failed)
                        {
                            failures.Add(new Failure(record, "Unknown"));
                        }
                    }
                }
            }

            return(failures);
        }
コード例 #3
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var timedOutTestTasks = from r in context.Timeline.Records
                                    where r.RecordType == "Task"
                                    where r.Result == TaskResult.Canceled
                                    select r;

            if (timedOutTestTasks.Count() > 0)
            {
                foreach (var timedOutTestTask in timedOutTestTasks)
                {
                    context.AddFailure(timedOutTestTask, "Cancelled Task");
                }
            }
        }
コード例 #4
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.Result == TaskResult.Failed
                              where r.RecordType == "Task"
                              where r.Task != null
                              where r.Task.Name == "Cache"
                              where r.Log != null
                              select r;

            foreach (var failedTask in failedTasks.Where(t => t.Issues.Any(i => IsChunkOrderingError(i.Message))))
            {
                context.AddFailure(failedTask, "Cache Chunk Ordering");
            }
        }
コード例 #5
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var jobs = from r in context.Timeline.Records
                       where r.RecordType == "Job"
                       where r.Issues.Any(i => i.Message.Contains("abandoned due to an infrastructure failure"))
                       select r;

            if (jobs.Count() > 0)
            {
                foreach (var job in jobs)
                {
                    context.AddFailure(job, "Azure Pipelines Pool Outage");
                }
            }
        }
コード例 #6
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.Name.StartsWith("Deploy test resources")
                              where r.Result == TaskResult.Failed
                              select r;

            if (failedTasks.Count() > 0)
            {
                foreach (var failedTask in failedTasks)
                {
                    context.AddFailure(failedTask, "Test Resource Failure");
                }
            }
        }
コード例 #7
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.RecordType == "Task"
                              where r.Result == TaskResult.Failed
                              where r.Name.StartsWith("Download secrets")
                              select r;

            if (failedTasks.Count() > 0)
            {
                foreach (var failedTask in failedTasks)
                {
                    context.AddFailure(failedTask, "Secerts Failure");
                }
            }
        }
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.RecordType == "Task"
                              where r.Name == "Start Cosmos DB Emulator"
                              where r.Result == TaskResult.Failed
                              select r;

            if (failedTasks.Count() > 0)
            {
                foreach (var failedTask in failedTasks)
                {
                    context.AddFailure(failedTask, "Cosmos DB Emulator Failure");
                }
            }
        }
コード例 #9
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var tasks = from r in context.Timeline.Records
                        where r.RecordType == "Task"
                        where r.Issues.Any(i => i.Message.Contains("Git fetch failed with exit code: 128"))
                        select r;

            if (tasks.Count() > 0)
            {
                foreach (var task in tasks)
                {
                    context.AddFailure(task
                                       , "Git Checkout");
                }
            }
        }
コード例 #10
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.Result == TaskResult.Failed
                              where r.RecordType == "Task"
                              where r.Name == "Install Azurite"
                              select r;

            if (failedTasks.Count() > 0)
            {
                foreach (var failedTask in failedTasks)
                {
                    context.AddFailure(failedTask, "Azurite Install");
                }
            }
        }
コード例 #11
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.Result == TaskResult.Failed
                              where r.RecordType == "Task"
                              where r.Log != null
                              select r;

            foreach (var failedTask in failedTasks)
            {
                var lines = await buildLogProvider.GetLogLinesAsync(context.Build, failedTask.Log.Id);

                if (lines.Any(line => IsDnsResolutionFailure(line)))
                {
                    context.AddFailure(failedTask, "DNS Resolution Failure");
                }
            }
        }
コード例 #12
0
        public async Task <IEnumerable <Failure> > AnalyzeFailureAsync(Build build, Timeline timeline)
        {
            var failures = new List <Failure>();

            var context = new FailureAnalyzerContext(build, timeline, failures);

            foreach (var classifier in classifiers)
            {
                await classifier.ClassifyAsync(context);
            }

            if (failures.Count == 0)
            {
                failures.Add(new Failure("Global", "Unknown"));
            }

            return(failures);
        }
コード例 #13
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.Result == TaskResult.Failed
                              where r.RecordType == "Task"
                              where r.Task != null
                              where r.Task.Name == "EsrpCodeSigning"
                              where r.Log != null
                              select r;

            if (failedTasks.Count() > 0)
            {
                foreach (var failedTask in failedTasks)
                {
                    context.AddFailure(failedTask, "Code Signing");
                }
            }
        }
コード例 #14
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            if (context.Build.Definition.Name.StartsWith("js -"))
            {
                var failedTasks = from r in context.Timeline.Records
                                  where r.Name == "Execute Samples"
                                  where r.Result == TaskResult.Failed
                                  select r;

                if (failedTasks.Count() > 0)
                {
                    foreach (var failedTask in failedTasks)
                    {
                        context.AddFailure(failedTask, "Sample Execution");
                    }
                }
            }
        }
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            if (context.Build.Definition.Name.EndsWith("- tests"))
            {
                var failedTasks = from r in context.Timeline.Records
                                  where r.Result == TaskResult.Failed
                                  where r.RecordType == "Task"
                                  where r.Name == "Install Azure PowerShell module"
                                  select r;

                if (failedTasks.Count() > 0)
                {
                    foreach (var failedTask in failedTasks)
                    {
                        context.AddFailure(failedTask, "Azure PS Module");
                    }
                }
            }
        }
コード例 #16
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            if (context.Build.Definition.Name.StartsWith("js -"))
            {
                var failedJobs = from r in context.Timeline.Records
                                 where r.Name == "Publish packages to daily feed"
                                 where r.RecordType == "Job"
                                 where r.Result == TaskResult.Failed
                                 select r;

                if (failedJobs.Count() > 0)
                {
                    foreach (var failedJob in failedJobs)
                    {
                        context.AddFailure(failedJob, "Publish Failure");
                    }
                }
            }
        }
コード例 #17
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            if (context.Build.Definition.Name.StartsWith("java - "))
            {
                var failedTasks = from r in context.Timeline.Records
                                  where r.Result == TaskResult.Failed
                                  where r.RecordType == "Task"
                                  where r.Name.StartsWith("Run tests")
                                  select r;

                if (failedTasks.Count() > 0)
                {
                    foreach (var failedTask in failedTasks)
                    {
                        context.AddFailure(failedTask, "Test Failure");
                    }
                }
            }
        }
コード例 #18
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.Result == TaskResult.Failed
                              where r.RecordType == "Task"
                              where r.Task != null
                              where r.Name == "Publish to Java Dev Feed"
                              where r.Log != null
                              select r;

            foreach (var failedTask in failedTasks)
            {
                var lines = await this.buildLogProvider.GetLogLinesAsync(context.Build, failedTask.Log.Id);

                if (lines.Any(line => line.Contains("Transfer failed for https://pkgs.dev.azure.com") && line.Contains("503 Service Unavailable")))
                {
                    context.AddFailure(failedTask, "Azure Artifacts Service Unavailable");
                }
            }
        }
コード例 #19
0
        public async Task ClassifyAsync(FailureAnalyzerContext context)
        {
            var failedTasks = from r in context.Timeline.Records
                              where r.Result == TaskResult.Failed
                              where r.RecordType == "Task"
                              where r.Task != null
                              where r.Task.Name == "Maven"
                              where r.Log != null
                              select r;

            foreach (var failedTask in failedTasks)
            {
                var lines = await buildLogProvider.GetLogLinesAsync(context.Build, failedTask.Log.Id);

                if (lines.Any(line => line.Contains("Connection reset") || line.Contains("Connection timed out") || line.Contains("504 Gateway Timeout")))
                {
                    context.AddFailure(failedTask, "Maven Broken Pipe");
                }
            }
        }