Investigate test_cleanup_gaia.py and test_power_button_long_press.py failures due to audio.volume.content setting

RESOLVED WONTFIX

Status

Firefox OS
Gaia::UI Tests
RESOLVED WONTFIX
2 years ago
2 years ago

People

(Reporter: Martijn Wargers (dead), Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
This has split of from bug 1196358.

That bug is fixed, but these tests are still failing.

I think I may know what the problem is.
In Gaia UI tests, we do this:
- We stop the B2G process
- We then change the settings.json file on the device, setting the audio.volume.content to 0.
- Then we restart the B2G process.

Apparently, the the fix for bug 1196358 didn't pick up this case, because that case is listening for settings changes and what we do in Gaia UI test is changing the settings.json file directly.

Alastor, can you comment here?
Is it unreasonable for Gaia UI test to expect this to work? (it works for other settings and is even necessary for some of them)
Flags: needinfo?(alwu)
Hi, Martin,
Sorry for my late reply,
Because Sotaro are doing the large refactoring of the AudioManager, and it would also change the volume changing architecture in Gecko.
Therefore, I think we can wait for its completion, and then check whether the issue still exist.

These bugs might solve this issue, bug 1196724 and bug1218629.
Flags: needinfo?(alwu)
(Reporter)

Updated

2 years ago
Depends on: 1196724, 1218629
(Reporter)

Comment 2

2 years ago
Alastor, I just retested, but this is still an issue. Can you take a look at this?
Flags: needinfo?(alwu)
(Reporter)

Comment 3

2 years ago
Created attachment 8705221 [details] [diff] [review]
all.diff

One of the tests is outdated now, it needed this patch to get the original failure.
Keep NI, I'll check it later.
Hi, Martin,

Now I can't run the GIP to check where the test case fail, could you tell me what is the error message from these tests?
In addition, do you know what is the relationship between "settings.json" and "audio.volume.[type]"?
In the bug1218629, it would save the different volume into the database, do these tests read the volume value from the same place?

Thanks!
Flags: needinfo?(martijn.martijn)
(Reporter)

Comment 6

2 years ago
TEST-UNEXPECTED-FAIL | test_cleanup_gaia.py TestCleanupGaia.test_cleanup_gaia | AssertionError: 8 != 0

Traceback (most recent call last):
  File "/Users/mwargers/.virtualenvs/zapion_test2/lib/python2.7/site-packages/marionette_client-2.0.0-py2.7.egg/marionette/marionette_test.py", line 344, in run
    testMethod()
  File "/Users/mwargers/B2G/gaia_clean/tests/python/gaia-ui-tests/gaiatest/tests/unit/test_cleanup_gaia.py", line 18, in test_cleanup_gaia
    self.check_initial_state()
  File "/Users/mwargers/B2G/gaia_clean/tests/python/gaia-ui-tests/gaiatest/tests/unit/test_cleanup_gaia.py", line 65, in check_initial_state
    'audio.volume.content'), 0)
TEST-INFO took 66531ms



Traceback (most recent call last):
  File "/Users/mwargers/.virtualenvs/zapion_test2/lib/python2.7/site-packages/marionette_client-2.0.0-py2.7.egg/marionette/marionette_test.py", line 344, in run
    testMethod()
  File "/Users/mwargers/B2G/gaia_clean/tests/python/gaia-ui-tests/gaiatest/tests/functional/system/test_power_button_long_press.py", line 21, in test_power_button_long_press
    sleep_menu.wait_for_sleep_menu_visible()
  File "/Users/mwargers/B2G/gaia_clean/tests/python/gaia-ui-tests/gaiatest/apps/system/regions/sleep_view.py", line 22, in wait_for_sleep_menu_visible
    Wait(self.marionette).until(expected.element_displayed(*self._sleep_menu_locator))
  File "/Users/mwargers/.virtualenvs/zapion_test2/lib/python2.7/site-packages/marionette_driver-1.1.1-py2.7.egg/marionette_driver/wait.py", line 143, in until
    cause=last_exc)
TEST-INFO took 73487ms


Alastor, you don't need to run these Gaia UI tests to see this issue, just do the following:
- adb stop b2g
- adb pull /system/b2g/defaults/settings.json
- Add or modify this entry in your settings.json file: "audio.volume.content": 0
- adb push settings.json /system/b2g/defaults/
- adb shell start b2g

After this, the bug shows by the fact that the audio.volume.content still remains 8.
Flags: needinfo?(martijn.martijn)
It seems that the settings.json doesn't be changed even I changed the phone volume. I tried to modify the phone volume and then pull out the setting.json, its content is totally different with my volume setting.

I have no idea how settings.json be related with the setting service event, what we did in gecko is just to dispatch the volume changing event to the setting DB.

---

Hi, Sotaro,
Because I don't know the details about how the setting event works, do you have any idea about this issue?
Very appreciate!
Flags: needinfo?(alwu) → needinfo?(sotaro.ikeda.g)
(In reply to Martijn Wargers [:mwargers] (QA) from comment #6)
> Alastor, you don't need to run these Gaia UI tests to see this issue, just
> do the following:
> - adb stop b2g
> - adb pull /system/b2g/defaults/settings.json
> - Add or modify this entry in your settings.json file:
> "audio.volume.content": 0
> - adb push settings.json /system/b2g/defaults/
> - adb shell start b2g

The above seems not related to the test failure. Replacing settings.json seems not update userValue.
settings.json is read only during first system start up and SETTINGSDB_VERSION updates by upgradeSchema(). Just replacing settings.json seems not trigger upgradeSchema(). And upgradeSchema() update only defaultValue. It does not update userValue.
 https://dxr.mozilla.org/mozilla-central/source/dom/settings/SettingsDB.jsm#56

In early days of fxos, there was no difference of defaultValue and userValue. Since Bug 821814, upgradeSchema() updates only default values.

If userValue exists, userValue is used as a value.
  https://dxr.mozilla.org/mozilla-central/source/dom/settings/SettingsRequestManager.jsm#423
Flags: needinfo?(sotaro.ikeda.g)
In local environment, I tested how upgradeSchema() works. It updated defaultValue, but it did not update userValue and did not update a "audio.volume.content" value that is returned to AudioManager.
test failure might be caused by a way of setting db usage by AudioManager.

For example, AudioManager watches updates of "audio.volume.content" to update audio volume. Its value is used to update audio volume of current active audio out. It does not update other audio out devices out. Current audio out device is different depends on system status.

Device dependent audio volumes are stored to the following setting. They are read during system start up and are updated when a volume is changed.

- audio.volume.content.earpiece
- audio.volume.content.speaker
- audio.volume.content.wired_headset
- audio.volume.content.wired_headphone
- audio.volume.content.bt_scoheadset
- audio.volume.content.bt_a2dp

Therefore even if "audio.volume.content" is set to default value, the change does not affect to another audio devices' volume.
AudioManager also writes to "audio.volume.content", during AudioManager initialization and current audio out device is changed.
(Reporter)

Comment 12

2 years ago
Marking WONTFIX, sorry for the bug spam. If somebody still wants to work on this, please file a new bug for it.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.