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

Test case, After #startListeningForAdvertisements call wifiPeerAvailabilityChanged events should be emitted, fails randomly on Android #718

Closed
tompaana opened this Issue Apr 27, 2016 · 3 comments

Comments

Projects
None yet
6 participants
@tompaana
Member

tompaana commented Apr 27, 2016

This test does not seem to do any native calls.

Logcat log below:

04-27 05:29:52.274  3369  3455 I jxcore-log: # teardown
04-27 05:29:52.274  3369  3455 I jxcore-log: 
04-27 05:29:52.294  3369  3455 I jxcore-log: # setup
04-27 05:29:52.294  3369  3455 I jxcore-log: 
04-27 05:29:52.313  3369  3455 I jxcore-log: ok 610 should be in started state
04-27 05:29:52.313  3369  3455 I jxcore-log: 
04-27 05:29:52.316  3369  3455 I jxcore-log: # 162. After #startListeningForAdvertisements call wifiPeerAvailabilityChanged events should be emitted
04-27 05:29:52.316  3369  3455 I jxcore-log: 
04-27 05:29:52.365  3369  3455 I jxcore-log: ok 611 peer identifier should match
04-27 05:29:52.365  3369  3455 I jxcore-log: 
04-27 05:29:52.366  3369  3455 I jxcore-log: ok 612 host address should match
04-27 05:29:52.366  3369  3455 I jxcore-log: 
04-27 05:29:52.366  3369  3455 I jxcore-log: ok 613 port should match
04-27 05:29:52.366  3369  3455 I jxcore-log: 
04-27 05:29:52.375  3369  3455 I jxcore-log: not ok 614 host address should be null
04-27 05:29:52.375  3369  3455 I jxcore-log: 
04-27 05:29:52.375  3369  3455 I jxcore-log:   ---
04-27 05:29:52.375  3369  3455 I jxcore-log: 
04-27 05:29:52.375  3369  3455 I jxcore-log:     operator: equal
04-27 05:29:52.375  3369  3455 I jxcore-log: 
04-27 05:29:52.375  3369  3455 I jxcore-log:     expected: null
04-27 05:29:52.375  3369  3455 I jxcore-log: 
04-27 05:29:52.375  3369  3455 I jxcore-log:     actual:   '4502e468'
04-27 05:29:52.375  3369  3455 I jxcore-log: 
04-27 05:29:52.375  3369  3455 I jxcore-log:   ...
04-27 05:29:52.375  3369  3455 I jxcore-log: 
04-27 05:29:52.379  3369  3455 I jxcore-log: not ok 615 port should should be null
04-27 05:29:52.379  3369  3455 I jxcore-log: 
04-27 05:29:52.379  3369  3455 I jxcore-log:   ---
04-27 05:29:52.379  3369  3455 I jxcore-log: 
04-27 05:29:52.379  3369  3455 I jxcore-log:     operator: equal
04-27 05:29:52.379  3369  3455 I jxcore-log: 
04-27 05:29:52.379  3369  3455 I jxcore-log:     expected: null
04-27 05:29:52.379  3369  3455 I jxcore-log: 
04-27 05:29:52.379  3369  3455 I jxcore-log:     actual:   8080
04-27 05:29:52.379  3369  3455 I jxcore-log: 
04-27 05:29:52.379  3369  3455 I jxcore-log:   ...
04-27 05:29:52.379  3369  3455 I jxcore-log: 
04-27 05:29:52.381  3369  3455 I jxcore-log: # teardown
04-27 05:29:52.381  3369  3455 I jxcore-log: 
04-27 05:29:52.414  3369  3455 I jxcore-log: ok 616 should not be in started state
04-27 05:29:52.414  3369  3455 I jxcore-log: 
04-27 05:29:52.418  3369  3455 I jxcore-log: # setup
04-27 05:29:52.418  3369  3455 I jxcore-log: 
04-27 05:29:52.439  3369  3455 I jxcore-log: ok 617 should be in started state
04-27 05:29:52.439  3369  3455 I jxcore-log: 

@tompaana tompaana added this to the New Infra milestone Apr 27, 2016

@vjrantal

This comment has been minimized.

Show comment
Hide comment
@vjrantal

vjrantal Apr 27, 2016

Member

I looked at the sources of the test and this might be a race condition where the test fails if there is an SSDP alive message on an exact moment. A diff something like this might help:

$ git diff
diff --git a/test/www/jxcore/bv_tests/testThaliWifiInfrastructure.js b/test/www/jxcore/bv_tests/testThaliWifiInfrastructure.js
index 91bb9af..4ec3303 100644
--- a/test/www/jxcore/bv_tests/testThaliWifiInfrastructure.js
+++ b/test/www/jxcore/bv_tests/testThaliWifiInfrastructure.js
@@ -79,7 +79,8 @@ test('After #startListeningForAdvertisements call ' +
       peerAvailableListener);

     var peerUnavailableListener = function (peer) {
-      if (peer.peerIdentifier !== peerIdentifier) {
+      if (peer.peerIdentifier !== peerIdentifier ||
+          peer.hostAddress !== null) {
         return;
       }
       t.equal(peer.hostAddress, null, 'host address should be null');

Even with above change, the test would be meaningful since it would fail unless a peer unavailable message comes after the test server is stopped.

Member

vjrantal commented Apr 27, 2016

I looked at the sources of the test and this might be a race condition where the test fails if there is an SSDP alive message on an exact moment. A diff something like this might help:

$ git diff
diff --git a/test/www/jxcore/bv_tests/testThaliWifiInfrastructure.js b/test/www/jxcore/bv_tests/testThaliWifiInfrastructure.js
index 91bb9af..4ec3303 100644
--- a/test/www/jxcore/bv_tests/testThaliWifiInfrastructure.js
+++ b/test/www/jxcore/bv_tests/testThaliWifiInfrastructure.js
@@ -79,7 +79,8 @@ test('After #startListeningForAdvertisements call ' +
       peerAvailableListener);

     var peerUnavailableListener = function (peer) {
-      if (peer.peerIdentifier !== peerIdentifier) {
+      if (peer.peerIdentifier !== peerIdentifier ||
+          peer.hostAddress !== null) {
         return;
       }
       t.equal(peer.hostAddress, null, 'host address should be null');

Even with above change, the test would be meaningful since it would fail unless a peer unavailable message comes after the test server is stopped.

@yaronyg yaronyg removed their assignment Jul 15, 2016

@yaronyg yaronyg added estimate - 2 and removed 2 - Ready labels Aug 8, 2016

@yaronyg yaronyg added the Node label Sep 26, 2016

@yaronyg

This comment has been minimized.

Show comment
Hide comment
@yaronyg

yaronyg Sep 27, 2016

Member

Do we even known if this is still failing?

Member

yaronyg commented Sep 27, 2016

Do we even known if this is still failing?

@artemjackson

This comment has been minimized.

Show comment
Hide comment
@artemjackson

artemjackson Sep 27, 2016

Contributor

@yaronyg I didn't face with this

Contributor

artemjackson commented Sep 27, 2016

@yaronyg I didn't face with this

@yaronyg yaronyg closed this Sep 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment