Skip to content

Commit

Permalink
Merge pull request #1039 from bugsnag/integration/app-hangs
Browse files Browse the repository at this point in the history
  • Loading branch information
nickdowell committed Mar 18, 2021
2 parents 5287d5c + 74e89d3 commit f33859d
Show file tree
Hide file tree
Showing 87 changed files with 2,465 additions and 1,739 deletions.
18 changes: 18 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ steps:
docker-compose#v3.3.0:
run: cocoa-maze-runner
command:
- "features/app_hangs.feature"
- "features/barebone_tests.feature"
- "--app=/app/build/iOSTestApp.ipa"
- "--farm=bs"
Expand All @@ -164,6 +165,7 @@ steps:
docker-compose#v3.3.0:
run: cocoa-maze-runner
command:
- "features/app_hangs.feature"
- "features/barebone_tests.feature"
- "--app=/app/build/iOSTestApp.ipa"
- "--farm=bs"
Expand All @@ -190,6 +192,7 @@ steps:
commands:
- bundle install
- bundle exec maze-runner
features/app_hangs.feature
features/barebone_tests.feature
--farm=local
--os=macos
Expand All @@ -198,5 +201,20 @@ steps:
--tags='not @skip_macos'
--fail-fast

- label: 'macOS 10.15 stress test'
timeout_in_minutes: 3
agents:
queue: opensource-mac-cocoa
env:
STRESS_TEST: "true"
commands:
- bundle install
- bundle exec maze-runner
features/stress_test.feature
--no-log-requests
artifact_paths:
- features/fixtures/macos-stress-test/BugsnagStressTest.stdout.log
- features/fixtures/macos-stress-test/BugsnagStressTest.stderr.log

- label: 'Conditionally trigger full set of tests'
command: sh -c .buildkite/pipeline_trigger.sh
232 changes: 146 additions & 86 deletions Bugsnag.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 0 additions & 2 deletions Bugsnag/BugsnagCrashSentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
#import "BSG_KSCrashReportWriter.h"
#import "BSG_KSCrashType.h"
#import "BugsnagConfiguration.h"
#import "BugsnagErrorReportApiClient.h"

@class BugsnagNotifier;

@interface BugsnagCrashSentry : NSObject

- (void)install:(BugsnagConfiguration *)config
apiClient:(BugsnagErrorReportApiClient *)apiClient
notifier:(BugsnagNotifier *)notifier
onCrash:(BSGReportCallback)onCrash;

Expand Down
9 changes: 2 additions & 7 deletions Bugsnag/BugsnagCrashSentry.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,21 @@

#import "BugsnagCrashSentry.h"

#import "BSGFileLocations.h"
#import "BSG_KSCrashAdvanced.h"
#import "BSG_KSCrashC.h"
#import "Bugsnag.h"
#import "BugsnagConfiguration.h"
#import "BugsnagErrorReportSink.h"
#import "BugsnagErrorTypes.h"
#import "BugsnagLogger.h"

@implementation BugsnagCrashSentry

- (void)install:(BugsnagConfiguration *)config
apiClient:(BugsnagErrorReportApiClient *)apiClient
notifier:(BugsnagNotifier *)notifier
onCrash:(BSGReportCallback)onCrash
{
BugsnagErrorReportSink *sink = [[BugsnagErrorReportSink alloc] initWithApiClient:apiClient configuration:config notifier:notifier];
BSG_KSCrash *ksCrash = [BSG_KSCrash sharedInstance];
ksCrash.sink = sink;
ksCrash.introspectMemory = NO;
ksCrash.onCrash = onCrash;
ksCrash.maxStoredReports = (int)config.maxPersistedEvents;
Expand All @@ -47,11 +44,9 @@ - (void)install:(BugsnagConfiguration *)config

bsg_kscrash_setHandlingCrashTypes(crashTypes);

if ((![ksCrash install])) {
if ((![ksCrash install:[BSGFileLocations current].kscrashReports])) {
bsg_log_err(@"Failed to install crash handler. No exceptions will be reported!");
}

[sink.apiClient flushPendingData];
}

/**
Expand Down
23 changes: 0 additions & 23 deletions Bugsnag/BugsnagErrorReportSink+Private.h

This file was deleted.

60 changes: 0 additions & 60 deletions Bugsnag/BugsnagErrorReportSink.h

This file was deleted.

169 changes: 0 additions & 169 deletions Bugsnag/BugsnagErrorReportSink.m

This file was deleted.

23 changes: 23 additions & 0 deletions Bugsnag/Client/BugsnagClient+AppHangs.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// BugsnagClient+AppHangs.h
// Bugsnag
//
// Created by Nick Dowell on 08/03/2021.
// Copyright © 2021 Bugsnag Inc. All rights reserved.
//

#import "BugsnagClient+Private.h"

#import "BSGAppHangDetector.h"

NS_ASSUME_NONNULL_BEGIN

@interface BugsnagClient (AppHangs) <BSGAppHangDetectorDelegate>

- (BOOL)lastRunEndedWithAppHang;

- (void)startAppHangDetector;

@end

NS_ASSUME_NONNULL_END
Loading

0 comments on commit f33859d

Please sign in to comment.