Comment 13 for bug 1700766

Revision history for this message
Jakub Skrzypnik (j.skrzypnik) wrote :

Hello, sorry for late reply, I've been on vacation.

But, looks like last cherry-pick from Amy's branch broke that token caching you're talking about.
Here's my task JSON:

{
"SwiftObjects.create_object_then_download_object_and_delete_object" :[
{
  "runner": {
    "type": "constant",
    "concurrency": 5,
    "times": 10
  },
  "args": {
    "container_name": "interia-test",
    "object_size": 8192,
    "objects_per_container": 1000
  },
  "context": {
    "users": {
      "cache_tokens": True
    }
  }
}
]
}

Don't bother about that task name - it's a custom task created only to test whole CRUD chain at once, not for public use ATM.

But when I'm trying to run task with "cache_tokens": True, the schema validation fails:

Subtask SwiftObjects.create_object_then_download_object_and_delete_object[0] has wrong configuration
Subtask configuration:
{"runner": {"type": "constant", "concurrency": 5, "times": 10}, "args": {"container_name": "interia-test", "object_size": 8192, "objects_per_container": 1000}, "context": {"users": {"cache_tokens": true}}}

Reason(s):
 {"cache_tokens": true} is valid under each of {'additionalProperties': False, 'description': 'Use existing users and tenants.', 'properties': {'user_choice_method': {'$ref': '#/definitions/user_choice_method'}, 'cache_tokens': {'$ref': '#/definitions/cache_tokens'}}}, {'additionalProperties': False, 'description': 'Create new temporary users and tenants.', 'properties': {'user_domain': {'type': 'string', 'description': 'ID of domain in which users will be created.'}, 'project_domain': {'type': 'string', 'description': 'ID of domain in which projects will be created.'}, 'cache_tokens': {'$ref': '#/definitions/cache_tokens'}, 'user_choice_method': {'$ref': '#/definitions/user_choice_method'}, 'users_per_tenant': {'minimum': 1, 'type': 'integer', 'description': 'The number of users to create per one tenant.'}, 'tenants': {'minimum': 1, 'type': 'integer', 'description': 'The number of tenants to create.'}, 'resource_management_workers': {'minimum': 1, 'type': 'integer', 'description': 'The number of concurrent threads to use for serving users context.'}}}

Failed validating 'oneOf' in schema:
    {'$schema': 'http://json-schema.org/draft-04/schema',
     'definitions': {'cache_tokens': {'description': 'Option to cache tokens in user context',
                                      'type': 'boolean'},
                     'user_choice_method': {'description': 'The mode of balancing usage of users between scenario iterations.',
                                            'enum': ['random',
                                                     'round_robin']}},
     'oneOf': [{'additionalProperties': False,
                'description': 'Create new temporary users and tenants.',
                'properties': {'cache_tokens': {'$ref': '#/definitions/cache_tokens'},
                               'project_domain': {'description': 'ID of domain in which projects will be created.',
                                                  'type': 'string'},
                               'resource_management_workers': {'description': 'The number of concurrent threads to use for serving users context.',
                                                               'minimum': 1,
                                                               'type': 'integer'},
                               'tenants': {'description': 'The number of tenants to create.',
                                           'minimum': 1,
                                           'type': 'integer'},
                               'user_choice_method': {'$ref': '#/definitions/user_choice_method'},
                               'user_domain': {'description': 'ID of domain in which users will be created.',
                                               'type': 'string'},
                               'users_per_tenant': {'description': 'The number of users to create per one tenant.',
                                                    'minimum': 1,
                                                    'type': 'integer'}}},
               {'additionalProperties': False,
                'description': 'Use existing users and tenants.',
                'properties': {'cache_tokens': {'$ref': '#/definitions/cache_tokens'},
                               'user_choice_method': {'$ref': '#/definitions/user_choice_method'}}}],
     'type': 'object'}

On instance:
    {"cache_tokens": true}`

Same thing with YAML input (in fact it's converted to JSON from what I know). But when I remove the cache_tokens option, and whole "users" section, it works well, but without caching.