Closed Bug 1000063 Opened 11 years ago Closed 7 years ago

[NFC] Test cases don't start on emulator

Categories

(Firefox OS Graveyard :: NFC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(tracking-b2g:backlog)

RESOLVED WONTFIX
tracking-b2g backlog

People

(Reporter: tzimmermann, Unassigned)

References

Details

Attachments

(4 files)

STR:

  - build NFC emulator
  - run test case './mach marionette-webapi gecko/dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js'

Expected:

  - test case runs and returns a result

Actual:

  -  emulator stops after displaying the home screen
Attached file qemu.log (deleted) —
The last things logged here are the NCI deactivated command and it's response. That seems to be related to the problem, although the emulator continues after the response has been processed. Shortly afterwards, it starts sleeping.
Attached file emulator-5554.log (deleted) —
The logcat still shows activity after the last NFC message has been processed.
I thought that the deactivation sequence is incorrectly emulated, but I can repeatedly enable and disable NFC by hand in the Settings app. So this seems to work in general.
NFC test cases work if I

  - build,
  - run the emulator,
  - switch NFC on and off in the Settings app,
  - quit the emulator, and
  - run the test case.

It does not work if I only execute the first and final step. Maybe there's something wrong with the Settings DB?
Blocks: 986527
Blocks: 980851
I can run it well by the build I built this morning.

However there are somethings I felt strange from your comments:

There's no Settings app when running marionette-webapi tests, what do you mean by 
'- switch NFC on and off in the Settings app,' when running marionette-webapi tests?
I use ./run-emulator.sh to start the emulator and open the Settings app to switch NFC on and off. And then I use mach to run the test case.
./mach marionette-webapi will launch the emulator so you don't have to call run-emulator beforehand.
But that's what this bug is about.

I _have_ to run ./run-emulator.sh and toggle NFC by hand, or ./mach marionette-webapi won't execute the test case.
Gecko is at 22b3e73265f8d6663ad6d1bb02a6a1bb07d430e3
Gaia is at a87266f3ddb4f43ac95924faedc0fa445cb3dffd
I still cannot reproduce this with those commits you provided.

allstars@allstars-PC:~/src/github/mozilla-b2g/B2G_emuJB$ ./mach marionette-webapi gecko/dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js 
waiting for system-message-listener-ready...
...done
waiting for homescreen...
...done
starting httpd
running webserver on http://10.247.24.33:60921/
TEST-START test_nfc_manager_tech_discovered.js
/home/allstars/src/github/mozilla-b2g/B2G_emuJB/gecko/dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js, runTest (marionette.marionette_test.MarionetteJSTestCase) ... ok

START LOG:
INFO TEST-START: /home/allstars/src/github/mozilla-b2g/B2G_emuJB/gecko/dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js Thu Apr 24 2014 10:42:31 GMT+0000 (UTC)
INFO Running 'testActivateRE0' Thu Apr 24 2014 10:42:33 GMT+0000 (UTC)
INFO Executing 'nfc ntf rf_intf_activated 0' Thu Apr 24 2014 10:42:35 GMT+0000 (UTC)
INFO Received 'nfc-manager-tech-discovered' Thu Apr 24 2014 10:42:35 GMT+0000 (UTC)
INFO Cleaning up Thu Apr 24 2014 10:42:37 GMT+0000 (UTC)
INFO TEST-END: /home/allstars/src/github/mozilla-b2g/B2G_emuJB/gecko/dom/nfc/tests/marionette/test_nfc_manager_tech_discovered.js Thu Apr 24 2014 10:42:37 GMT+0000 (UTC)
END LOG:

----------------------------------------------------------------------
Ran 1 test in 9.383s

OK

SUMMARY
-------
passed: 1
failed: 0
todo: 0
allstars@allstars-PC:~/src/github/mozilla-b2g/B2G_emuJB$ cd gecko
allstars@allstars-PC:~/src/github/mozilla-b2g/B2G_emuJB/gecko$ git show
commit 22b3e73265f8d6663ad6d1bb02a6a1bb07d430e3
Merge: 800a964 aef7853
Author: Ryan VanderMeulen <ryanvm@gmail.com>
Date:   Mon Apr 21 16:16:55 2014 -0400

    Merge b2g-inbound to m-c.

allstars@allstars-PC:~/src/github/mozilla-b2g/B2G_emuJB/gecko$ cd ../gaia/
allstars@allstars-PC:~/src/github/mozilla-b2g/B2G_emuJB/gaia$ git show
commit a87266f3ddb4f43ac95924faedc0fa445cb3dffd
Merge: 5e98fb6 e34145c
Author: Gabriele Svelto <gsvelto@mozilla.com>
Date:   Tue Apr 22 10:39:47 2014 +0200

    Merge pull request #18339 from kumarrishav/issue-980402
    
    Bug 980402 - Remove navigator.mozMobileConnection uses from the homescreen app / everything.me r=crdlc
Yeah, I can't really explain what's happening, but it's 100% reproducible for me. Maybe a race condition somewhere. :/
blocking-b2g: --- → backlog
This bug blocks NFC 2.0 release.
Blocks: b2g-NFC-2.0
Test again after bug 1009483 landed.
Depends on: 1009483, 933595
Blocks: 973133
Vicamo suggested that this problem might be related to not grabbing a wake lock. Unfortunately grabbing one on boot doesn't fix the problem.
I tried it, but I am stuck on some other test case startup issue with 7/16 code on Flame. Does hacking in a test case delay on enabling NFC help if the script is starting with NFC off (My emu build has settings app).
Hi Malini,

I have a question about Marionette.

Whenever I run an NFC test over Marionette, the emulator goes to sleep after displaying 'waiting for homescreen...', and the test fails with a timeout after a while.

How does Marionette handle wakelocks? I wonder if it needs to acquire a wake lock keep the emulator running.
Flags: needinfo?(mdas)
Hi Dimi,

I'd like to see the log of a working test. Could you run 'test_nfc_manger_ndef_discovered.js' and attach the logcat to this bug?
Flags: needinfo?(dlee)
(In reply to Thomas Zimmermann [:tzimmermann] [:tdz] from comment #16)
> Hi Malini,
> 
> I have a question about Marionette.
> 
> Whenever I run an NFC test over Marionette, the emulator goes to sleep after
> displaying 'waiting for homescreen...', and the test fails with a timeout
> after a while.
> 
> How does Marionette handle wakelocks? I wonder if it needs to acquire a wake
> lock keep the emulator running.

Marionette doesn't have any concept of wake locks. If there is a way to prevent sleeping via a gecko preference, then we can set that preference by pushing a modified profile to the emulator (by adding "--profile=/path/to/profile_dir" when running the test) or we can patch Marionette/mozrunner to add this preference to the user.js before we start the emulator.
Flags: needinfo?(mdas)
Flags: needinfo?(dlee)
I think I finally figured out what happens here. Emulator startup takes so long that Gaia suspends the system after the suspend timeout has been reached. With the system suspended, Marionette runs into its own timeout sooner or later. Please watch bug 1108271 if you're interested in a fix for this issue.
blocking-b2g: backlog → ---
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: