openvstorage / framework-alba-plugin

The Framework ALBA plugin extends the OpenvStorage GUI with functionality to manage ASDs (Alternate Storage Daemon) and Seagate Kinetic drives.
Other
2 stars 3 forks source link

alba_backend.presets returns wrong values #515

Open jeroenmaelbrancke opened 6 years ago

jeroenmaelbrancke commented 6 years ago

One of our test scenarios is create a preset, sleep 1 second, check if this one exists and delete it again.

Sometimes the created preset is not listed when we run BackendList.get_by_name(albabackend_name).alba_backend.presets

Error from the scenario:

2017-10-26 00:15:48 51100 +0200 - DEV-3N-199-181 - 5442/140354151106304 - scenario-ci_scenario_add_remove_backend/autotests.py - wrapped - 602 - ERROR - Test ci_scenario_add_remove_backend has failed with error: Preset `integrationtests` 
does not exists but it should on backend `mybackend`.
Traceback (most recent call last):
  File "/opt/OpenvStorage/ci/autotests.py", line 459, in wrapped
    result = func(*args, **kwargs)  # Execute the method
  File "/opt/OpenvStorage/ci/scenarios/backend/be_0002_add_update_remove_preset_test/main.py", line 49, in main
    return AddUpdateRemovePreset.validate_add_update_remove_preset()
  File "/opt/OpenvStorage/ci/scenarios/backend/be_0002_add_update_remove_preset_test/main.py", line 144, in validate_add_update_remove_preset
    AddUpdateRemovePreset._add_remove_preset(alba_backend.name, preset_details, preset_def, api)
  File "/opt/OpenvStorage/ci/scenarios/backend/be_0002_add_update_remove_preset_test/main.py", line 193, in _add_remove_preset
    .format(preset_details['name'], albabackend_name)
AssertionError: Preset `integrationtests` does not exists but it should on backend `mybackend`

scenario: https://github.com/openvstorage/integrationtests/blob/master/ci/scenarios/backend/be_0002_add_update_remove_preset_test/main.py#L191

A small test on Alba create-preset, list-preset, delete-preset didn't triggered this issue. So for some reason Framework cached some stuff and do not return the correct values.

kvanhijf commented 6 years ago

I've created a script to add / validate / delete a preset

while True:
    AlbaPresetController.add_preset(alba_backend.guid, name='test', compression='snappy', policies=[[2,2,3,4]], encryption='aes-cbc-256')
    print 'Preset added'
    if not any(pr['name'] for pr in alba_backend.presets if pr['name'] == 'test'):
        break
    print 'Preset present'
    AlbaPresetController.delete_preset(alba_backend.guid, name='test')
    print 'Preset removed'
    if any(pr['name'] for pr in alba_backend.presets if pr['name'] == 'test'):
        print 'Preset still present, while it should have been removed'
        break
    print ''

It has now been running for over 5 minutes and still succeeding, so it does not seem to be an issue in the framework. Please provide us with more information or investigate this issue further in the integrationtests first

wimpers commented 6 years ago

@jeroenmaelbrancke can you please reproduce or if needed close with can't reproduce

jeroenmaelbrancke commented 6 years ago

For example: http://testrail.openvstorage.com/index.php?/tests/view/1317639

wimpers commented 6 years ago

@jeroenmaelbrancke can we investigate if it is an integration test issue as Kevin pointed out that his side works (apperently). Maybe this is a caching problem?

JeffreyDevloo commented 6 years ago

Has to be re-evaluated. There were some list-caching issue and these have been resolved in the meantime by https://github.com/openvstorage/framework/issues/1991