change test condition

This commit is contained in:
yangdsh 2020-05-25 18:12:08 +00:00 committed by Dana Van Aken
parent ae85ea26a1
commit 70b9a7c566
1 changed files with 14 additions and 14 deletions

View File

@ -1076,10 +1076,10 @@ def integration_tests():
# wait celery periodic task finishes # wait celery periodic task finishes
assert wait_pipeline_data_ready(), "Pipeline data failed" assert wait_pipeline_data_ready(), "Pipeline data failed"
total_n = 30 total_n = 20
first_n = 5
last_n = 10 last_n = 10
average = 0
max_gain = 0
simulate_db_run(1, {'effective_cache_size': '0kB'}) simulate_db_run(1, {'effective_cache_size': '0kB'})
for i in range(2, total_n + 2): for i in range(2, total_n + 2):
LOG.info('Test GPR (gaussian process regression)') LOG.info('Test GPR (gaussian process regression)')
@ -1088,12 +1088,12 @@ def integration_tests():
response = get_result(upload_code='ottertuneTestTuningGPR') response = get_result(upload_code='ottertuneTestTuningGPR')
assert response['status'] == 'good' assert response['status'] == 'good'
gain = simulate_db_run(i, response['recommendation']) gain = simulate_db_run(i, response['recommendation'])
if i < first_n + 2: if max_gain < gain:
average += gain / first_n max_gain = gain
elif i > total_n - last_n + 2: elif i > total_n - last_n + 2:
assert gain > average assert gain > max_gain / 2.0
average = 0 max_gain = 0
simulate_db_run(1, {'effective_cache_size': '0kB'}) simulate_db_run(1, {'effective_cache_size': '0kB'})
for i in range(2, total_n + 2): for i in range(2, total_n + 2):
LOG.info('Test DNN (deep neural network)') LOG.info('Test DNN (deep neural network)')
@ -1102,12 +1102,12 @@ def integration_tests():
response = get_result(upload_code='ottertuneTestTuningDNN') response = get_result(upload_code='ottertuneTestTuningDNN')
assert response['status'] == 'good' assert response['status'] == 'good'
gain = simulate_db_run(i, response['recommendation']) gain = simulate_db_run(i, response['recommendation'])
if i < first_n + 2: if max_gain < gain:
average += gain / first_n max_gain = gain
elif i > total_n - last_n + 2: elif i > total_n - last_n + 2:
assert gain > average assert gain > max_gain / 2.0
average = 0 max_gain = 0
simulate_db_run(1, {'effective_cache_size': '0kB'}) simulate_db_run(1, {'effective_cache_size': '0kB'})
for i in range(2, total_n + 2): for i in range(2, total_n + 2):
upload_result(result_dir='./integrationTests/data/', prefix='x__', upload_result(result_dir='./integrationTests/data/', prefix='x__',
@ -1115,10 +1115,10 @@ def integration_tests():
response = get_result(upload_code='ottertuneTestTuningDDPG') response = get_result(upload_code='ottertuneTestTuningDDPG')
assert response['status'] == 'good' assert response['status'] == 'good'
gain = simulate_db_run(i, response['recommendation']) gain = simulate_db_run(i, response['recommendation'])
if i < first_n + 2: if max_gain < gain:
average += gain / first_n max_gain = gain
elif i > total_n - last_n + 2: elif i > total_n - last_n + 2:
assert gain > average assert gain > max_gain / 2.0
LOG.info("\n\nIntegration Tests: PASSED!!\n") LOG.info("\n\nIntegration Tests: PASSED!!\n")