Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Create tests to see if Android is corrupting data #1426

Closed
yaronyg opened this issue Oct 25, 2016 · 0 comments
Closed

Create tests to see if Android is corrupting data #1426

yaronyg opened this issue Oct 25, 2016 · 0 comments
Assignees

Comments

@yaronyg
Copy link
Member

yaronyg commented Oct 25, 2016

The Problem: We are seeing really odd results where we consistently are able to successfully retrieve beacons but then in many cases not able to successfully deliver any requests for replication. (See #1415) We can see connections and data flowing but no actual request ever seems to hit the express server and very quickly (usually within 300ms) the replication fails with a 500 Socket Hangup failure. In addition we have also seen cases where we are getting SSL errors that only occur if SSL receives mangled data (see thaliproject/jxcore#69).

Our Thesis: We think that data on Android is being corrupted somewhere.

Test of Thesis:

In our infrastructure we have a layer cake:
Raw Socket <--- Mux Layer <--- TCP Connection <--- PSK <--- Actual connection data

So to test things out we need to peel back the layers.

Testing the Raw Socket is really easy and we already have a test for that, testThaliMobileNative.'can shift large amounts of data'. Right now 'large' is just 4k but we can up to that to whatever we want.

Next up we have the mux layer. We do have some tests in testCreateNativeListener but those aren't coordinated tests. So what I need to do is write a variant of the tests in there that do run with the coordinator. But there is more. It's not clear if our data corruption is really data corruption or maybe just some issue with creating and destroying mux streams. We honestly aren't sure. So we need to test both.

What I specifically need to do is:

  1. Create N parallel promises.
  2. For each promise open a TCP socket and generate a randomly determined amount of data, send it down and have the other side echo it back. Then close the socket and open a new socket and do it again.

The test ends when all N sockets successfully complete or one somehow fails.

We then need a variant of the above test where the clients and server use PSK just to see if that is the cause of our problems.

@yaronyg yaronyg self-assigned this Oct 25, 2016
@yaronyg yaronyg closed this as completed Oct 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant