Re: Review Request 47564: Activate HAWQSTANDBY fails on retry

2016-05-19 Thread Matt


> On May 18, 2016, 6:32 p.m., Lav Jain wrote:
> > ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py, line 197
> > 
> >
> > You may want to take this opportunity to refactor the test code.
> > 
> > ExecuteScript can be a separate function with command passed in as 
> > parameter.
> > 
> > Similarily, common.stop_component can be refactored into a separate 
> > function with both test_stop_default and test_activate_hawq_standby calling 
> > it.
> > 
> > If you want to go one step further, create a base class of 
> > TestHawqCommon(RMFTestCase) that defines the corresponding routines in 
> > common.py with TestHawqStandby(TestHawqCommon).
> > 
> > assertResourceCalled can be defined using functools.partial

I did think about refactoring while working on this JIRA. And I thought should 
do the refactoring separately as part of refactoring HAWQ's python unit tests.
I did not want to overdo with the refactoring at this point. 

I've added the JIRA: https://issues.apache.org/jira/browse/AMBARI-16758


- Matt


---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/47564/#review133857
---


On May 18, 2016, 4:28 p.m., Matt wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/47564/
> ---
> 
> (Updated May 18, 2016, 4:28 p.m.)
> 
> 
> Review request for Ambari, Alexander Denissov, bhuvnesh chaudhary, and Lav 
> Jain.
> 
> 
> Bugs: AMBARI-16750
> https://issues.apache.org/jira/browse/AMBARI-16750
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> If wizard failed on the Activate Standby step, retrying the step would cause 
> a failure, because the master hosts have been switched already in the 
> configuration.
> Resolution: Before retrying the command, rewrite the configuration with 
> current topology.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
>  45dcff0 
>   ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py e247d28 
> 
> Diff: https://reviews.apache.org/r/47564/diff/
> 
> 
> Testing
> ---
> 
> Manually Tested.
> 
> Added unit test.
> 
> test_hawq_master_critical 
> (test_alert_component_status.TestAlertComponentStatus) ... ok
> test_hawq_master_ok (test_alert_component_status.TestAlertComponentStatus) 
> ... ok
> test_hawq_segment_critical 
> (test_alert_component_status.TestAlertComponentStatus) ... ok
> test_hawq_segment_ok (test_alert_component_status.TestAlertComponentStatus) 
> ... ok
> test_hawq_standby_critical 
> (test_alert_component_status.TestAlertComponentStatus) ... ok
> test_hawq_standby_ok (test_alert_component_status.TestAlertComponentStatus) 
> ... ok
> test_missing_configs (test_alert_component_status.TestAlertComponentStatus) 
> ... ok
> test_exception_registration_status 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... No 
> handlers could be found for logger "ambari_alerts"
> ok
> test_missing_configs 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_missing_slave_file 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_successful_registration_status 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_unsuccessful_empty_db_registration_status 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_unsuccessful_registration_status 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_unsuccessful_registration_status_plural 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_missing_configs (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_no_standby_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_none_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_not_configured_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_not_synchronized_state (test_alert_sync_status.TestAlertSyncStatus) ... 
> ok
> test_synchronized_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_synchronizing_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_unknown_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_configure_default (test_hawqmaster.TestHawqMaster) ... ok
> test_install_default (test_hawqmaster.TestHawqMaster) ... ok
> test_remove_hawq_standby (test_hawqmaster.TestHawqMaster)
> Run custom command Remove HAWQ Standby ... 2016-05-18 16:27:14,657 - Removing 
> HAWQ Standby Master ...
> ok
> test_resync_hawq_standby 

Re: Review Request 47564: Activate HAWQSTANDBY fails on retry

2016-05-18 Thread Lav Jain

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/47564/#review133857
---




ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py (line 197)


You may want to take this opportunity to refactor the test code.

ExecuteScript can be a separate function with command passed in as 
parameter.

Similarily, common.stop_component can be refactored into a separate 
function with both test_stop_default and test_activate_hawq_standby calling it.

If you want to go one step further, create a base class of 
TestHawqCommon(RMFTestCase) that defines the corresponding routines in 
common.py with TestHawqStandby(TestHawqCommon).

assertResourceCalled can be defined using functools.partial


- Lav Jain


On May 18, 2016, 11:28 p.m., Matt wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/47564/
> ---
> 
> (Updated May 18, 2016, 11:28 p.m.)
> 
> 
> Review request for Ambari, Alexander Denissov, bhuvnesh chaudhary, and Lav 
> Jain.
> 
> 
> Bugs: AMBARI-16750
> https://issues.apache.org/jira/browse/AMBARI-16750
> 
> 
> Repository: ambari
> 
> 
> Description
> ---
> 
> If wizard failed on the Activate Standby step, retrying the step would cause 
> a failure, because the master hosts have been switched already in the 
> configuration.
> Resolution: Before retrying the command, rewrite the configuration with 
> current topology.
> 
> 
> Diffs
> -
> 
>   
> ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
>  45dcff0 
>   ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py e247d28 
> 
> Diff: https://reviews.apache.org/r/47564/diff/
> 
> 
> Testing
> ---
> 
> Manually Tested.
> 
> Added unit test.
> 
> test_hawq_master_critical 
> (test_alert_component_status.TestAlertComponentStatus) ... ok
> test_hawq_master_ok (test_alert_component_status.TestAlertComponentStatus) 
> ... ok
> test_hawq_segment_critical 
> (test_alert_component_status.TestAlertComponentStatus) ... ok
> test_hawq_segment_ok (test_alert_component_status.TestAlertComponentStatus) 
> ... ok
> test_hawq_standby_critical 
> (test_alert_component_status.TestAlertComponentStatus) ... ok
> test_hawq_standby_ok (test_alert_component_status.TestAlertComponentStatus) 
> ... ok
> test_missing_configs (test_alert_component_status.TestAlertComponentStatus) 
> ... ok
> test_exception_registration_status 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... No 
> handlers could be found for logger "ambari_alerts"
> ok
> test_missing_configs 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_missing_slave_file 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_successful_registration_status 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_unsuccessful_empty_db_registration_status 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_unsuccessful_registration_status 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_unsuccessful_registration_status_plural 
> (test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
> test_missing_configs (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_no_standby_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_none_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_not_configured_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_not_synchronized_state (test_alert_sync_status.TestAlertSyncStatus) ... 
> ok
> test_synchronized_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_synchronizing_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_unknown_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
> test_configure_default (test_hawqmaster.TestHawqMaster) ... ok
> test_install_default (test_hawqmaster.TestHawqMaster) ... ok
> test_remove_hawq_standby (test_hawqmaster.TestHawqMaster)
> Run custom command Remove HAWQ Standby ... 2016-05-18 16:27:14,657 - Removing 
> HAWQ Standby Master ...
> ok
> test_resync_hawq_standby (test_hawqmaster.TestHawqMaster)
> Run custom command Resync HAWQ Standby ... 2016-05-18 16:27:14,661 - HAWQ 
> Standby Master Re-Sync started in fast mode...
> ok
> test_run_hawq_check_case1 (test_hawqmaster.TestHawqMaster)
> Running HAWQ Check Case 1: Non HDFS-HA, Standalone Resource Management, Not 
> Kerberized ... 2016-05-18 16:27:14,666 - Executing HAWQ Check ...
> ok
> test_run_hawq_check_case10 (test_hawqmaster.TestHawqMaster)
> Running 

Review Request 47564: Activate HAWQSTANDBY fails on retry

2016-05-18 Thread Matt

---
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/47564/
---

Review request for Ambari, Alexander Denissov, bhuvnesh chaudhary, and Lav Jain.


Bugs: AMBARI-16750
https://issues.apache.org/jira/browse/AMBARI-16750


Repository: ambari


Description
---

If wizard failed on the Activate Standby step, retrying the step would cause a 
failure, because the master hosts have been switched already in the 
configuration.
Resolution: Before retrying the command, rewrite the configuration with current 
topology.


Diffs
-

  
ambari-server/src/main/resources/common-services/HAWQ/2.0.0/package/scripts/hawqstandby.py
 45dcff0 
  ambari-server/src/test/python/stacks/2.3/HAWQ/test_hawqstandby.py e247d28 

Diff: https://reviews.apache.org/r/47564/diff/


Testing
---

Manually Tested.

Added unit test.

test_hawq_master_critical 
(test_alert_component_status.TestAlertComponentStatus) ... ok
test_hawq_master_ok (test_alert_component_status.TestAlertComponentStatus) ... 
ok
test_hawq_segment_critical 
(test_alert_component_status.TestAlertComponentStatus) ... ok
test_hawq_segment_ok (test_alert_component_status.TestAlertComponentStatus) ... 
ok
test_hawq_standby_critical 
(test_alert_component_status.TestAlertComponentStatus) ... ok
test_hawq_standby_ok (test_alert_component_status.TestAlertComponentStatus) ... 
ok
test_missing_configs (test_alert_component_status.TestAlertComponentStatus) ... 
ok
test_exception_registration_status 
(test_alert_segment_registration_status.TestAlertRegistrationStatus) ... No 
handlers could be found for logger "ambari_alerts"
ok
test_missing_configs 
(test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
test_missing_slave_file 
(test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
test_successful_registration_status 
(test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
test_unsuccessful_empty_db_registration_status 
(test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
test_unsuccessful_registration_status 
(test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
test_unsuccessful_registration_status_plural 
(test_alert_segment_registration_status.TestAlertRegistrationStatus) ... ok
test_missing_configs (test_alert_sync_status.TestAlertSyncStatus) ... ok
test_no_standby_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
test_none_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
test_not_configured_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
test_not_synchronized_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
test_synchronized_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
test_synchronizing_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
test_unknown_state (test_alert_sync_status.TestAlertSyncStatus) ... ok
test_configure_default (test_hawqmaster.TestHawqMaster) ... ok
test_install_default (test_hawqmaster.TestHawqMaster) ... ok
test_remove_hawq_standby (test_hawqmaster.TestHawqMaster)
Run custom command Remove HAWQ Standby ... 2016-05-18 16:27:14,657 - Removing 
HAWQ Standby Master ...
ok
test_resync_hawq_standby (test_hawqmaster.TestHawqMaster)
Run custom command Resync HAWQ Standby ... 2016-05-18 16:27:14,661 - HAWQ 
Standby Master Re-Sync started in fast mode...
ok
test_run_hawq_check_case1 (test_hawqmaster.TestHawqMaster)
Running HAWQ Check Case 1: Non HDFS-HA, Standalone Resource Management, Not 
Kerberized ... 2016-05-18 16:27:14,666 - Executing HAWQ Check ...
ok
test_run_hawq_check_case10 (test_hawqmaster.TestHawqMaster)
Running HAWQ Check Case 10: HDFS-HA, YARN Resource Management Non YARN_HA, 
Kerberized ... 2016-05-18 16:27:14,674 - Executing HAWQ Check ...
ok
test_run_hawq_check_case11 (test_hawqmaster.TestHawqMaster)
Running HAWQ Check Case 11: HDFS-HA, YARN Resource Management YARN_HA, Not 
Kerberized ... 2016-05-18 16:27:14,681 - Executing HAWQ Check ...
ok
test_run_hawq_check_case12 (test_hawqmaster.TestHawqMaster)
Running HAWQ Check Case 12: HDFS-HA, YARN Resource Management YARN_HA, 
Kerberized ... 2016-05-18 16:27:14,688 - Executing HAWQ Check ...
ok
test_run_hawq_check_case2 (test_hawqmaster.TestHawqMaster)
Running HAWQ Check Case 2: Non HDFS-HA, Standalone Resource Management, 
Kerberized ... 2016-05-18 16:27:14,694 - Executing HAWQ Check ...
ok
test_run_hawq_check_case3 (test_hawqmaster.TestHawqMaster)
Running HAWQ Check Case 3: Non HDFS-HA, YARN Resource Management Non YARN_HA, 
Not Kerberized ... 2016-05-18 16:27:14,700 - Executing HAWQ Check ...
ok
test_run_hawq_check_case4 (test_hawqmaster.TestHawqMaster)
Running HAWQ Check Case 4: Non HDFS-HA, YARN Resource Management Non YARN_HA, 
Kerberized ... 2016-05-18 16:27:14,707 - Executing HAWQ Check ...
ok
test_run_hawq_check_case5 (test_hawqmaster.TestHawqMaster)
Running HAWQ Check