Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure to delete test cases when the number of test cases in the test plan is greater than 100 #1149

Closed
radiateboy opened this issue Sep 27, 2019 · 2 comments
Labels
bug

Comments

@radiateboy
Copy link

@radiateboy radiateboy commented Sep 27, 2019

https://public.tenant.kiwitcms.org/plan/2408/test-mou-yan-ce-shi-ji-hua#reviewcases

Description of problem

  1. add test case in test plan and test cases greater than 100
  2. select all cases and delete all.
    20190927174441
@atodorov

This comment has been minimized.

Copy link
Member

@atodorov atodorov commented Sep 27, 2019

Reported as KIWI-TCMS-8F on Sentry

InvalidQuery: Field TestCase.case_status cannot be both deferred and traversed using select_related at the same time.
  File "django/core/handlers/exception.py", line 34, in inner
    response = get_response(request)
  File "django/core/handlers/base.py", line 115, in _get_response
    response = self.process_exception_by_middleware(e, request)
  File "django/core/handlers/base.py", line 113, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/generic/base.py", line 71, in view
    return self.dispatch(request, *args, **kwargs)
  File "django/views/generic/base.py", line 97, in dispatch
    return handler(request, *args, **kwargs)
  File "tcms/testplans/views.py", line 503, in post
    for case in cases:
  File "django/db/models/query.py", line 274, in __iter__
    self._fetch_all()
  File "django/db/models/query.py", line 1242, in _fetch_all
    self._result_cache = list(self._iterable_class(self))
  File "django/db/models/query.py", line 55, in __iter__
    results = compiler.execute_sql(chunked_fetch=self.chunked_fetch, chunk_size=self.chunk_size)
  File "django/db/models/sql/compiler.py", line 1087, in execute_sql
    sql, params = self.as_sql()
  File "django/db/models/sql/compiler.py", line 474, in as_sql
    extra_select, order_by, group_by = self.pre_sql_setup()
  File "django/db/models/sql/compiler.py", line 54, in pre_sql_setup
    self.setup_query()
  File "django/db/models/sql/compiler.py", line 45, in setup_query
    self.select, self.klass_info, self.annotation_col_map = self.get_select()
  File "django/db/models/sql/compiler.py", line 240, in get_select
    related_klass_infos = self.get_related_selections(select)
  File "django/db/models/sql/compiler.py", line 830, in get_related_selections
    only_load.get(field_model)):
  File "django/db/models/query_utils.py", line 253, in select_related_descend
    (field.model._meta.object_name, field.name))

@RMadjev want to give this a try ?

@atodorov atodorov added the bug label Sep 27, 2019
@RMadjev

This comment has been minimized.

Copy link
Member

@RMadjev RMadjev commented Sep 27, 2019

Sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.