ni / ni/nimi-python

niswitch system tests that use session-simulated DAQmx devices fail intermittently and hence disabled

Open
#1,622 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

niswitch test
Dominant language
Python
Stars
128
Forks
110
Avg merge
5d 14h
Merged PRs (30d)
10

Description

Description of issue

Tests in question:
https://github.com/ni/nimi-python/blob/065267a827bb0c8256a5122d33be28f8987a0265/src/niswitch/system_tests/test_system_niswitch.py#L64
https://github.com/ni/nimi-python/blob/065267a827bb0c8256a5122d33be28f8987a0265/src/niswitch/system_tests/test_system_niswitch.py#L110

The error log:

=================================== ERRORS ====================================
_____________ ERROR at setup of test_continuous_software_scanning _____________

    @pytest.fixture(scope='function')
    def session_2532():
        with daqmx_sim_db_lock:
>           simulated_session = niswitch.Session('', '2532/1-Wire 4x128 Matrix', True, False)

..\..\src\niswitch\system_tests\test_system_niswitch.py:32: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
niswitch\session.py:1562: in __init__
    self._vi = self._init_with_topology(resource_name, topology, simulate, reset_device)
niswitch\session.py:2274: in _init_with_topology
    errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

session = niswitch.Session(repeated_capability_list=[], vi=None, library=None, encoding=None)
code = -1074135030, ignore_warnings = False, is_error_handling = False

    def handle_error(session, code, ignore_warnings, is_error_handling):
        '''handle_error
    
        Helper function for handling errors returned by niswitch.Library.
        It calls back into the session to get the corresponding error description
        and raises if necessary.
        '''
    
        if _is_success(code) or (_is_warning(code) and ignore_warnings):
            return
    
        if is_error_handling:
            # The caller is in the midst of error handling and an error occurred.
            # Don't try to get the description or we'll start recursing until the stack overflows.
            description = ''
        else:
            description = session._get_error_description(code)
    
        if _is_error(code):
>           raise DriverError(code, description)
E           niswitch.errors.DriverError: -1074135030: IVI: (Hex 0xBFFA000A) Failure loading driver module.
E           
E           The driver for the DAQmx switch is not loaded

niswitch\errors.py:102: DriverError
System report
python -c 'import niswitch; niswitch.print_diagnostic_information()'
OS:
   Name:      Windows
   Version:   10.0.19041
   Bits:      64
Driver:
   Name:      NI-SWITCH
   Version:   20.5.0.49152
Module:
   Name:      niswitch
   Version:   1.3.4.dev0
Python:
   Version:   3.6.8 (tags/v3.6.8:3c6b436a57, Dec 24 2018, 00:16:47) [MSC v.1916 64 bit (AMD64)]
   Bits:      64
   Is_Venv:   True
   Installed Packages:
       niswitch==1.3.4.dev0
       zipp==3.4.1
       wheel==0.33.6
       typing-extensions==3.10.0.0
       toml==0.10.2
       six==1.16.0
       setuptools==42.0.2
       scipy==1.5.4
       pytest==6.2.4
       pytest-json==0.4.0
       pyparsing==2.4.7
       py==1.10.0
       pluggy==0.13.1
       pip==21.1.2
       packaging==20.9
       numpy==1.19.5
       iniconfig==1.1.1
       importlib-metadata==4.3.0
       hightime==0.2.0
       fasteners==0.16
       coverage==5.5
       colorama==0.4.4
       attrs==21.2.0
       atomicwrites==1.4.0

These tests had been problematic earlier too - #268, #276.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the referenced tests in src/niswitch/system_tests/test_system_niswitch.py, especially the session_2532 fixture and the tests around lines 64 and 110. Reproduce the intermittent DAQmx driver-module loading error and review the related issues #268 and #276. Done means the session-simulated tests run reliably without the reported DriverError.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.