From 00ec08ad277d355693864a3fd25c912db7eca194 Mon Sep 17 00:00:00 2001 From: Steve Kirkland Date: Fri, 4 Dec 2020 12:07:44 +0000 Subject: [PATCH 1/7] Trial addition of sleep between start and run scenario --- .../features/fixtures/app/scenario_js/app/App.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/react-native/features/fixtures/app/scenario_js/app/App.js b/test/react-native/features/fixtures/app/scenario_js/app/App.js index c79fd58736..d89127f0ee 100644 --- a/test/react-native/features/fixtures/app/scenario_js/app/App.js +++ b/test/react-native/features/fixtures/app/scenario_js/app/App.js @@ -58,6 +58,10 @@ export default class App extends Component { this.setState({ sessionsEndpoint: 'https://sessions.bugsnag.com' }) } + timeout (ms) { + return new Promise(resolve => setTimeout(resolve, ms)) + } + startScenario = async () => { console.log(`Running scenario: ${this.state.currentScenario}`) console.log(` with MetaData: ${this.state.scenarioMetaData}`) @@ -69,6 +73,8 @@ export default class App extends Component { console.log(` with config: ${JSON.stringify(configuration)} (native) and ${JSON.stringify(jsConfig)} (js)`) await NativeModules.BugsnagTestInterface.startBugsnag(configuration) Bugsnag.start(jsConfig) + // TODO Comment this if it actually helps + await this.timeout(2000) scenario.run() } From 14fcc9fd40bda5105ba02d8ae07cd3c20817bf8a Mon Sep 17 00:00:00 2001 From: Steve Kirkland Date: Fri, 4 Dec 2020 12:40:20 +0000 Subject: [PATCH 2/7] Correct command for Android --- TESTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TESTING.md b/TESTING.md index da6415ddb7..5989a678ef 100644 --- a/TESTING.md +++ b/TESTING.md @@ -197,7 +197,7 @@ npm run test:build-react-native-ios Fnd Android: ```shell script -npm run test:build-react-native-ios +npm run test:build-react-native-android ``` These will build a `.ipa` or `.apk` file respectively and copy into `./build`. From 4e95c4cef881a75bcd9a11c4a42bf58461382ea0 Mon Sep 17 00:00:00 2001 From: Steve Kirkland Date: Fri, 4 Dec 2020 12:40:45 +0000 Subject: [PATCH 3/7] Increase delay --- .../react-native/features/fixtures/app/scenario_js/app/App.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/react-native/features/fixtures/app/scenario_js/app/App.js b/test/react-native/features/fixtures/app/scenario_js/app/App.js index d89127f0ee..8891dfaeae 100644 --- a/test/react-native/features/fixtures/app/scenario_js/app/App.js +++ b/test/react-native/features/fixtures/app/scenario_js/app/App.js @@ -73,8 +73,8 @@ export default class App extends Component { console.log(` with config: ${JSON.stringify(configuration)} (native) and ${JSON.stringify(jsConfig)} (js)`) await NativeModules.BugsnagTestInterface.startBugsnag(configuration) Bugsnag.start(jsConfig) - // TODO Comment this if it actually helps - await this.timeout(2000) + // The notifier needs a little time to synch to the native layer, otherwise flakes occur + await this.timeout(5000) scenario.run() } From 8b538f86c481ce946486b7ed27d9b98edfd28295 Mon Sep 17 00:00:00 2001 From: Steve Kirkland Date: Fri, 4 Dec 2020 20:37:09 +0000 Subject: [PATCH 4/7] Add debug --- .buildkite/react-native-pipeline.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.buildkite/react-native-pipeline.yml b/.buildkite/react-native-pipeline.yml index 1f602d418e..7677179dd3 100644 --- a/.buildkite/react-native-pipeline.yml +++ b/.buildkite/react-native-pipeline.yml @@ -223,6 +223,7 @@ steps: - --fail-fast env: SKIP_NAVIGATION_SCENARIOS: "true" + DEBUG: "true" concurrency: 10 concurrency_group: 'browserstack-app' @@ -246,6 +247,7 @@ steps: - --fail-fast env: SKIP_NAVIGATION_SCENARIOS: "true" + DEBUG: "true" concurrency: 10 concurrency_group: 'browserstack-app' @@ -268,6 +270,7 @@ steps: - --fail-fast env: SKIP_NAVIGATION_SCENARIOS: "true" + DEBUG: "true" concurrency: 10 concurrency_group: 'browserstack-app' @@ -291,6 +294,7 @@ steps: - --fail-fast env: SKIP_NAVIGATION_SCENARIOS: "true" + DEBUG: "true" concurrency: 10 concurrency_group: 'browserstack-app' From a36f69ce2b2dc25d1ba338bcd8fd44208eff7fa3 Mon Sep 17 00:00:00 2001 From: Steve Kirkland Date: Fri, 4 Dec 2020 22:12:46 +0000 Subject: [PATCH 5/7] Leave more time before restarting app --- test/react-native/features/steps/react-native-steps.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/react-native/features/steps/react-native-steps.rb b/test/react-native/features/steps/react-native-steps.rb index c6b8b7d2aa..dd3307a47e 100644 --- a/test/react-native/features/steps/react-native-steps.rb +++ b/test/react-native/features/steps/react-native-steps.rb @@ -16,8 +16,8 @@ When("I relaunch the app") do # This step should only be used when the app has crashed, but the notifier needs a little - # time to write the crash report before being forced to reopen. From trials, 1s was not enough. - sleep(2) + # time to write the crash report before being forced to reopen. From trials, 2s was not enough. + sleep(5) MazeRunner.driver.launch_app end From 1bb977a8978bc10784c655e55f7c9fc83cc2bbe6 Mon Sep 17 00:00:00 2001 From: Steve Kirkland Date: Fri, 4 Dec 2020 22:14:09 +0000 Subject: [PATCH 6/7] Remove debug --- .buildkite/react-native-pipeline.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.buildkite/react-native-pipeline.yml b/.buildkite/react-native-pipeline.yml index 9da2751652..fd20228c58 100644 --- a/.buildkite/react-native-pipeline.yml +++ b/.buildkite/react-native-pipeline.yml @@ -223,7 +223,6 @@ steps: - --fail-fast env: SKIP_NAVIGATION_SCENARIOS: "true" - DEBUG: "true" concurrency: 9 concurrency_group: 'browserstack-app' @@ -247,7 +246,6 @@ steps: - --fail-fast env: SKIP_NAVIGATION_SCENARIOS: "true" - DEBUG: "true" concurrency: 9 concurrency_group: 'browserstack-app' @@ -270,7 +268,6 @@ steps: - --fail-fast env: SKIP_NAVIGATION_SCENARIOS: "true" - DEBUG: "true" concurrency: 9 concurrency_group: 'browserstack-app' @@ -294,7 +291,6 @@ steps: - --fail-fast env: SKIP_NAVIGATION_SCENARIOS: "true" - DEBUG: "true" concurrency: 9 concurrency_group: 'browserstack-app' From 434bb3bc748e7b57bdb7be5b06775817cf770a1a Mon Sep 17 00:00:00 2001 From: Steve Kirkland Date: Mon, 7 Dec 2020 11:50:38 +0000 Subject: [PATCH 7/7] Adjust timing --- .../features/fixtures/app/scenario_js/app/App.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/react-native/features/fixtures/app/scenario_js/app/App.js b/test/react-native/features/fixtures/app/scenario_js/app/App.js index 8891dfaeae..c08a76d9e2 100644 --- a/test/react-native/features/fixtures/app/scenario_js/app/App.js +++ b/test/react-native/features/fixtures/app/scenario_js/app/App.js @@ -73,8 +73,10 @@ export default class App extends Component { console.log(` with config: ${JSON.stringify(configuration)} (native) and ${JSON.stringify(jsConfig)} (js)`) await NativeModules.BugsnagTestInterface.startBugsnag(configuration) Bugsnag.start(jsConfig) - // The notifier needs a little time to synch to the native layer, otherwise flakes occur - await this.timeout(5000) + // The notifier needs a little time to synch to the native layer, otherwise flakes occur - however it's also + // important that the scenario waits longer than this period before relaunching the app (see the Cucumber step + // 'I relaunch the app'). + await this.timeout(2000) scenario.run() }