Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for case when stream splits log lines. #4

Merged
merged 1 commit into from Feb 17, 2015

Conversation

ashcoding
Copy link

This bug causes some parts of the lines to vanish after the split.

Example would be in this scenario:
Data callback 1:

I/TiAPI   ( 2856):  !TEST_RESULTS_START!
I/TiAPI   ( 2856): {
I/TiAPI   ( 2856):  "date": "2015-01-23T08:04:59.765Z",
I/TiAPI   ( 2856):  "results": [
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 1040,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testAPI"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 9660,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testLength"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 98065,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testAppend"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 58124,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testInsert"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 9049,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testInsertBlogExample"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 64461,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testCopy"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "failed",
I/TiAPI   ( 2856):          "duration": 3481,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testClone",
I/TiAPI   ( 2856):          "error": {
I/TiAPI   ( 2856):              "name": "AssertionError",
I/TiAPI   ( 2856):              "actual": {
I/TiAPI   ( 2856):                  "length": 20,
I/TiAPI   ( 2856):                  "bubbleParent": true,
I/TiAPI   ( 2856):                  "apiName": "Ti.Buffer"
I/TiAPI   ( 2856):              },
I/TiAPI   ( 2856):              "expected": {
I/TiAPI   ( 2856):                  "length": 20,
I/TiAPI   ( 2856):                  "bubbleParent": true,
I/TiAPI   ( 2856):                  "byteOrder": 1,
I/TiAPI   ( 2856):                  "apiName": "Ti.Buffer"
I/TiAPI   ( 2856):              },
I/TiAPI   ( 2856):              "operator": "to equal",
I/TiAPI   ( 2856):              "message": "expected { _hasJavaListener: undefined,\n length: 20,\n bubbleParent: true,\n byteOrder: undefined,\n type: undefined,\n value: undefined,\n apiName: 'Ti.Buffer' } to equal { _hasJavaListener: undefined,\n length: 20,\n bubbleParent: true,\n byteOrder: 1,\n type: undefined,\n value: undefined,\n apiName: 'Ti.Buffer' }",
I/TiAPI   ( 2856):              "generatedMessage": true,
I/TiAPI   ( 2856):              "showDiff": true
I/TiAPI   ( 2856):          }
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 92516,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testFill"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 1110,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testClear"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 528,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testRelease"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 18048,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testToStringAndBlob"
I/TiAPI   ( 2856):      },
I/TiAPI   ( 2856):      {
I/TiAPI   ( 2856):          "state": "passed",
I/TiAPI   ( 2856):          "duration": 1223,
I/TiAPI   ( 2856):          "suite": "buffer",
I/TiAPI   ( 2856):          "title": "testAutoEncode"
I/TiAPI   ( 2856):      }
I/TiAPI   ( 2856):  ],
I/TiAPI   ( 2856):  "platform": {
I/TiAPI   ( 2856):      "ostype": "32bit",
I/TiAPI   ( 2856):      "name": "android",
I/TiAPI   ( 2856):      "osname": "android",
I/TiAPI   ( 2856):      "version": "4.4.4",
I/TiAPI   ( 2856):      "ad

Data callback 2

dress": "10.0.3.15",
I/TiAPI   ( 2856):      "macaddress": "08:00:27:e5:f1:d0",
I/TiAPI   ( 2856):      "architecture": "Unknown",
I/TiAPI   ( 2856):      "availableMemory": 415984,
I/TiAPI   ( 2856):      "manufacturer": "Genymotion",
I/TiAPI   ( 2856):      "model": "Google Nexus 5 - 4.4.4 - API 19 - 1080x1920"
I/TiAPI   ( 2856):  },
I/TiAPI   ( 2856):  "displayCaps": {
I/TiAPI   ( 2856):      "density": "xxhigh",
I/TiAPI   ( 2856):      "dpi": 480,
I/TiAPI   ( 2856):      "platformHeight": 1776,
I/TiAPI   ( 2856):      "platformWidth": 1080,
I/TiAPI   ( 2856):      "xdpi": 480,
I/TiAPI   ( 2856):      "ydpi": 480
I/TiAPI   ( 2856):  },
I/TiAPI   ( 2856):  "build": {
I/TiAPI   ( 2856):      "date": "2015/01/12 15:33",
I/TiAPI   ( 2856):      "git": "0014f83",
I/TiAPI   ( 2856):      "version": "3.5.0"
I/TiAPI   ( 2856):  }
I/TiAPI   ( 2856): }
I/TiAPI   ( 2856): !TEST_RESULTS_STOP!

The last part of the address, dress": "10.0.3.15", would cause the original code to return, hence that part is not sent out to the logger at all. This causes the json to be incomplete and causing errors.

@ashcoding
Copy link
Author

I found some inconstant behavior of this fix. Will look into this.

@ashcoding
Copy link
Author

Note: This still needs more work.

@ashcoding ashcoding force-pushed the Android_Fix branch 2 times, most recently from ca3202f to d3872eb Compare February 2, 2015 03:17
@ashcoding
Copy link
Author

For this fix:-

  1. Used a module found from npm named "adbkit-logcat". It handles Android logs well and solves the issue.
  2. Bumped up androidlib version to 0.1.8

Using adbkit-logcat module to handle logs
@ashcoding
Copy link
Author

@skypanther
Copy link

APPROVED

skypanther added a commit that referenced this pull request Feb 17, 2015
Fix for case when stream splits log lines.
@skypanther skypanther merged commit 35d21c1 into tidev:master Feb 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants