At least one active unit assignment

Issue #285 resolved
Crystal Angers created an issue

On the Set references and tolerances page the "At least one active unit assignment" filter does not work. This is reproducible for a test that is assigned to both an active unit and an inactive unit. In this case the test does NOT show up when the filter is applied.

Comments (13)

  1. Randle Taylor

    @cangers I haven't been able to reproduce this. If I create a test list with one test, assign the test list to both an active and inactive unit, it still shows up in the Set References and Tolerances.

    inactive.jpg

  2. Crystal Angers reporter

    HI Randy, I think this “bug” is worth investigating further because it catches me often and it is very real: we have a number of “active” tests that do not show up when I select “at least one active unit” My hunch is that it is somehow related to the fact that the tests that don’t show up belong to a sublist.

    Here is the long drawn out scenario with screen shots:

    • We have a test list called “energy latency common” which contains a large number of tests (more than 20) including: “PDD Consistency” and “200mm OAR Consistency”
    • The “energy latency common” testlist is a sublist in a number of testlists. Some of these testlists belong to active units some do not
    • If I apply the active unit test list filters (on the set references and tolerances page) here is what I see for the “200mm OAR consistency” test, Note: Unit01 and Unit02 are active units, xUnit01HiArt_2005 and xUnit02HiArt_2006 are inactive[cid:image005.jpg@01D3490C.587193F0]

    [cid:image006.jpg@01D3490C.587193F0]

    • I think the screen shots clearly demonstrate the bug given that the tests do not show up on when the “at least on active unit assignment” is on and that ALL test show up with the “no active unit assignments”. A second set of screen shots shows the same problem for the a second test, “PDD consistency” [cid:image007.jpg@01D3490C.587193F0]

    [cid:image008.jpg@01D3490C.587193F0]

    I hope this helps Randy. Let me know if you need anymore info,

    Xtal

    PS the screen shots are from Ryan’s test environment because our production version of QATrack+ will not load the references and tolerances page. A significant (and hopefully solvable) problem which Ryan B has solved on one other occasion.

  3. Randle Taylor

    Screen shots didn't come through, but I bet you're right on with the sublist idea. Thanks, hopefully that will let me track it down.

    Very interested to hear you're having an issue with the references and tolerances page?!? Does it throw a server error? @ryanbottema do you have a traceback you can share?

  4. Crystal Angers reporter

    I sent the email to your gmail acct too. Did the screen shots come thru on it? Happy to find another way (sharept) to share the screen shots if they would be helpful Xtal

    Get Outlook for iOShttps://aka.ms/o0ukef

  5. Ryan Bottema

    Re: ref and tol page load error. It is a DatabaseError: Query timeout expired, see trace below. I believe I already addressed a related issue in 0.3.0 by adding 'list_select_related' to UnitTestInfoAdmin. Not sure if this fixed the issue completely, but I have no issues with this page in my 0.3.0 test environment with a similarly populated database.

    In the past I.T. allocated an extra 2GB of RAM to MSSQL on our server and that seemed to cure it for v0.2.9, but it appears to be back.

    Traceback (most recent call last):

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\core\handlers\base.py", line 112, in get_response
    response = wrapped_callback(request, callback_args, *callback_kwargs)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\contrib\admin\options.py", line 465, in wrapper
    return self.admin_site.admin_view(view)(args, *kwargs)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\utils\decorators.py", line 99, in _wrapped_view
    response = view_func(request, args, *kwargs)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\views\decorators\cache.py", line 52, in _wrapped_view_func
    response = view_func(request, args, *kwargs)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\contrib\admin\sites.py", line 198, in inner
    return view(request, args, *kwargs)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\utils\decorators.py", line 29, in _wrapper
    return bound_func(args, *kwargs)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\utils\decorators.py", line 99, in _wrapped_view
    response = view_func(request, args, *kwargs)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\utils\decorators.py", line 25, in bound_func
    return func(self, args2, *kwargs2)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\contrib\admin\options.py", line 1444, in changelist_view
    'selection_note': _('0 of %(cnt)s selected') % {'cnt': len(cl.result_list)},

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\db\models\query.py", line 77, in len
    self._fetch_all()

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\db\models\query.py", line 857, in _fetch_all
    self._result_cache = list(self.iterator())

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\db\models\query.py", line 220, in iterator
    for row in compiler.results_iter():

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\db\models\sql\compiler.py", line 713, in results_iter
    for rows in self.execute_sql(MULTI):

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\db\models\sql\compiler.py", line 786, in execute_sql
    cursor.execute(sql, params)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\db\backends\util.py", line 53, in execute
    return self.cursor.execute(sql, params)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\db\utils.py", line 99, in exit
    six.reraise(dj_exc_type, dj_exc_value, traceback)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\django\db\backends\util.py", line 53, in execute
    return self.cursor.execute(sql, params)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\sqlserver_ado\dbapi.py", line 574, in execute
    self._execute_command()

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\sqlserver_ado\dbapi.py", line 488, in _execute_command
    self._raiseCursorError(klass, _message)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\sqlserver_ado\dbapi.py", line 423, in _raiseCursorError
    eh(self.connection, self, errorclass, errorvalue)

    File "c:\deploy\virtualenvs\qatrack_029\lib\site-packages\sqlserver_ado\dbapi.py", line 92, in standardErrorHandler
    raise errorclass(errorvalue)

    DatabaseError: (-2147352567, 'Exception occurred.', (0, u'Microsoft SQL Server Native Client 10.0', u'Query timeout expired', None, 0, -2147217871), None)
    Command: SELECT DISTINCT TOP 100 [qa_unittestinfo].[id], [qa_unittestinfo].[unit_id], [qa_unittestinfo].[test_id], [qa_unittestinfo].[reference_id], [qa_unittestinfo].[tolerance_id], [qa_unittestinfo].[active], [qa_unittestinfo].[assigned_to_id], [units_unit].[id], [units_unit].[number], [units_unit].[name], [units_unit].[serial_number], [units_unit].[location], [units_unit].[install_date], [units_unit].[type_id], [qa_test].[id], [qa_test].[name], [qa_test].[slug], [qa_test].[description], [qa_test].[procedure], [qa_test].[category_id], [qa_test].[chart_visibility], [qa_test].[auto_review], [qa_test].[type], [qa_test].[hidden], [qa_test].[skip_without_comment], [qa_test].[display_image], [qa_test].[choices], [qa_test].[constant_value], [qa_test].[calculation_procedure], [qa_test].[created], [qa_test].[created_by_id], [qa_test].[modified], [qa_test].[modified_by_id], [qa_reference].[id], [qa_reference].[name], [qa_reference].[type], [qa_reference].[value], [qa_reference].[created], [qa_reference].[created_by_id], [qa_reference].[modified], [qa_reference].[modified_by_id], [qa_tolerance].[id], [qa_tolerance].[type], [qa_tolerance].[act_low], [qa_tolerance].[tol_low], [qa_tolerance].[tol_high], [qa_tolerance].[act_high], [qa_tolerance].[mc_pass_choices], [qa_tolerance].[mc_tol_choices], [qa_tolerance].[created_date], [qa_tolerance].[created_by_id], [qa_tolerance].[modified_date], [qa_tolerance].[modified_by_id] FROM [qa_unittestinfo] INNER JOIN [units_unit] ON ( [qa_unittestinfo].[unit_id] = [units_unit].[id] ) INNER JOIN [qa_test] ON ( [qa_unittestinfo].[test_id] = [qa_test].[id] ) LEFT OUTER JOIN [qa_reference] ON ( [qa_unittestinfo].[reference_id] = [qa_reference].[id] ) LEFT OUTER JOIN [qa_tolerance] ON ( [qa_unittestinfo].[tolerance_id] = [qa_tolerance].[id] ) INNER JOIN [qa_testlistmembership] ON ( [qa_test].[id] = [qa_testlistmembership].[test_id] ) WHERE [qa_testlistmembership].[test_list_id] IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) ORDER BY [qa_unittestinfo].[id] DESC

    Parameters:
    [Name: p0, Dir.: Input, Type: adInteger, Size: -1, Value: "19", Precision: 0, NumericScale: 0, Name: p1, Dir.: Input, Type: adInteger, Size: -1, Value: "20", Precision: 0, NumericScale: 0, Name: p2, Dir.: Input, Type: adInteger, Size: -1, Value: "26", Precision: 0, NumericScale: 0, Name: p3, Dir.: Input,
    ...

    < etc. omitted for brevity >

    ...
    adInteger, Size: -1, Value: "254", Precision: 0, NumericScale: 0, Name: p182, Dir.: Input, Type: adInteger, Size: -1, Value: "35", Precision: 0, NumericScale: 0, Name: p183, Dir.: Input, Type: adInteger, Size: -1, Value: "35", Precision: 0, NumericScale: 0]

  6. Randle Taylor

    Original issue resolved in 0ea5e6f . Thanks for the sublist clue.

    The timeout is very strange. The list_select_related is effectively covered by the select_related in the UnitTestInfo.queryset() function on master ( there's < 20 queries done on the Set References and Tolerances page on master which is the same as 0.3.0). Does it time out if you don't use the default active on at least one unit filter (go directly to admin/qa/unittestinfo/?activeassignment=all to test)?

  7. Crystal Angers reporter

    Ryan organized a server reboot yesterday which fixed the problem. In general qatrack has been slow and this too has been corrected with the reboot. We have not had a server reboot in over 6months (although my memory is questionable) Xtal

    Get Outlook for iOShttps://aka.ms/o0ukef

  8. Ryan Bottema

    Ah, yes, right you are. Anyways, it's working for now, but I'm guessing this will be an issue again here in another 6 months or so. activeassignment=all works great, but two of the queries generated with either active or inactive filters are fairly cumbersome relative to any other QAT basic functionality (outside of some charting) that I've noticed.

    screenshot-127.0.0.1-8000 2017-10-23 12-31-30-800.png

  9. Randle Taylor

    Yeah, those are ugly for sure and it would be nice to improve on them. Still, I'm surprised they're causing such an issue.

  10. Log in to comment