device-automation-bus / dab-adapter-rs

Apache License 2.0
2 stars 8 forks source link

Code refactor: Make a code cleanup and handle errors correctly #35

Closed denisyuji closed 10 months ago

arun-madhavan-013 commented 11 months ago

SystemSettings list conformance when triggered causes crash with this change.

DAB<->RDK Adapter [e9fcb148f49557ff88c971ccb625df3736d10287]
DAB Device ID: A09DC16EB2C6
Ready to process DAB requests
processing: system/settings/list
thread 'main' panicked at src/device/rdk/interface.rs:199:48:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: rust_begin_unwind
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/std/src/panicking.rs:597:5
   1: core::panicking::panic_fmt
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:72:14
   2: core::panicking::panic
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/panicking.rs:127:5
   3: core::option::Option<T>::unwrap
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/option.rs:935:21
   4: dab_adapter::device::rdk::interface::rdk_request_impl
             at ./src/device/rdk/interface.rs:199:13
   5: dab_adapter::device::rdk::interface::rdk_request
             at ./src/device/rdk/interface.rs:148:5
   6: dab_adapter::device::rdk::interface::service_is_available
             at ./src/device/rdk/interface.rs:252:11
   7: dab_adapter::device::rdk::system::settings::list::process
             at ./src/device/rdk/system/settings/list.rs:179:28
   8: dab_adapter::dab::call_function
             at ./src/dab.rs:60:13
   9: dab_adapter::dab::run
             at ./src/dab.rs:207:29
  10: dab_adapter::main
             at ./src/adapter.rs:210:5
  11: core::ops::function::FnOnce::call_once
             at /rustc/79e9716c980570bfd1f666e3b16ac583f0168962/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Error channel tx: RecvError
arun-madhavan-013 commented 11 months ago

Another issue is the error seems unreliable when running same tests back to back.

d35@d35-VirtualBox:~/Desktop/dab-compliance-suite$ dabSingleTest SystemSettingsSetOutputresolution
testing system/settings/set   {"outputResolution": {"width": 3840, "height": 2160, "frequency": 60} } ... [ 
Error: self.dab_client.last_error_code()
Request invalid or malformed ]
{
  "status": 400,
  "error": "Setting 'pictureMode' is not supported"
}

d35@d35-VirtualBox:~/Desktop/dab-compliance-suite$ dabSingleTest SystemSettingsSetOutputresolution
testing system/settings/set   {"outputResolution": {"width": 3840, "height": 2160, "frequency": 60} } ... [ 
Error: self.dab_client.last_error_code()
Internal error ]
{
  "status": 500,
  "error": "org.rdk.DisplaySettings.setCurrentResolution failed"
}

d35@d35-VirtualBox:~/Desktop/dab-compliance-suite$ dabSingleTest SystemSettingsSetOutputresolution
testing system/settings/set   {"outputResolution": {"width": 3840, "height": 2160, "frequency": 60} } ... [ 
Error: self.dab_client.last_error_code()
Request invalid or malformed ]
{
  "status": 400,
  "error": "Setting 'lowLatencyMode' is not supported"
}

d35@d35-VirtualBox:~/Desktop/dab-compliance-suite$ dabSingleTest SystemSettingsSetOutputresolution
testing system/settings/set   {"outputResolution": {"width": 3840, "height": 2160, "frequency": 60} } ... [ 
Error: self.dab_client.last_error_code()
Request invalid or malformed ]
{
  "status": 400,
  "error": "Setting 'lowLatencyMode' is not supported"
}
arun-madhavan-013 commented 11 months ago

When running OutputImageConformance, could see the request received but it gets stuck there.

arun-madhavan-013 commented 11 months ago

All voice related tests are failing with 500 (both audio and text based).


35@d35-VirtualBox:~/Desktop/dab-compliance-suite$ dabSingleTest VoiceSendAudioVoiceMute
testing voice/send-audio   {"fileLocation": "https://storage.googleapis.com/ytlr-cert.appspot.com/voice/setvolume0.wav", "voiceSystem": "Alexa"} ... [ 
Error: self.dab_client.last_error_code()
Internal error ]
{
  "status": 500,
  "error": "org.rdk.VoiceControl.voiceSessionRequest failed"
}

d35@d35-VirtualBox:~/Desktop/dab-compliance-suite$ dabSingleTest VoiceSendTextVoiceVolumeUp
testing voice/send-text   {"requestText" : "Set volume 5", "voiceSystem": "Alexa"} ... [ 
Error: self.dab_client.last_error_code()
Internal error ]
{
  "status": 500,
  "error": "org.rdk.VoiceControl.voiceSessionRequest failed"
}
``
denisyuji commented 10 months ago

SystemSettings list conformance when triggered causes crash with this change.

Thanks, @arun-madhavan-013 , fixed it, following the suggestion from @xhaakon