New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 655856 link

Starred by 1 user

Issue metadata

Status: Duplicate
Owner:
Last visit > 30 days ago
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android , Chrome
Pri: 2
Type: Bug



Sign in to add a comment

CTS : ImportError: No module named lockfile

Project Member Reported by avkodipelli@chromium.org, Oct 14 2016

Issue description

I have run the job in lab by cloning "samus-release/R54-8743.62.0/arc-cts/cheets_CTS.6.0_r9.arm.android.os". 

but it is failing by throwing import error.

Traceback (most recent call last):
    File "/usr/local/autotest/server/server_job.py", line 843, in group_func
      test.runtest(self, url, tag, args, dargs)
    File "/usr/local/autotest/server/test.py", line 289, in runtest
      *logging_args)
    File "/usr/local/autotest/client/common_lib/test.py", line 867, in runtest
      exec ('import %s' % modulename, local_namespace, global_namespace)
    File "<string>", line 1, in <module>
    File "/usr/local/autotest/server/site_tests/cheets_CTS/cheets_CTS.py", line 22, in <module>
      from autotest_lib.server.cros import tradefed_test
    File "/usr/local/autotest/server/cros/tradefed_test.py", line 44, in <module>
      import lockfile
  ImportError: No module named lockfile
  
10/13 12:00:14.866 INFO |        server_job:0153| END ABORT	cheets_CTS.android.os	cheets_CTS.android.os	timestamp=1476385214	localtime=Oct 13 12:00:14	No module named lockfile
  Traceback (most recent call last):
    File "/usr/local/autotest/server/server_job.py", line 870, in _run_group
      result = function(*args, **dargs)
    File "/usr/local/autotest/server/server_job.py", line 843, in group_func
      test.runtest(self, url, tag, args, dargs)
    File "/usr/local/autotest/server/test.py", line 289, in runtest
      *logging_args)
    File "/usr/local/autotest/client/common_lib/test.py", line 867, in runtest
      exec ('import %s' % modulename, local_namespace, global_namespace)
    File "<string>", line 1, in <module>
    File "/usr/local/autotest/server/site_tests/cheets_CTS/cheets_CTS.py", line 22, in <module>
      from autotest_lib.server.cros import tradefed_test
    File "/usr/local/autotest/server/cros/tradefed_test.py", line 44, in <module>
      import lockfile
  ImportError: No module named lockfile

Similar CTS tests are running lab without any issue. 

Please find entire logs at : 

https://pantheon.corp.google.com/storage/browser/chromeos-autotest-results/80740245-avkodipelli/chromeos2-row4-rack1-host7/debug/

 
Cc: dshi@chromium.org ihf@chromium.org
+Dan/Ilja

The code seems to check if it's in the container and if so, install it then.  Do you know why lockfile wasn't around?


Here's the pertinent codepath:

try:                                                                                                                                     
    import lockfile                                                                                                                      
except ImportError:                                                                                                                      
    if utils.is_in_container():                                                    
        # Ensure the container has the required packages installed.                
        lxc.install_packages(python_packages=['lockfile'])                         
        import lockfile                                                                                                                  
    else:                                                                                                                                
        raise            

Comment 3 by dshi@chromium.org, Oct 14 2016

We can certainly add lockfile to puppet, so all lab drones will have the package. That will allow the test to run in lab without using server-side packaging. However, the test needs to be in public Autotest repo and requires push to prod to update.

Comment 4 by ihf@chromium.org, Oct 14 2016

Most of the test (well, at least cheets_CTS.py) lives in the public autotest repo now. I integrated this change yesterday, but it does seem to cause problems on M54. See also https://b.corp.google.com/issues/32157737
Not sure if  Issue 648771  is related. We had a problem with scheduling a single test in the lab from AFE. Though test_that :lab: works fine.
Status: Assigned (was: Untriaged)
Mergedinto: 700021
Status: Duplicate (was: Assigned)

Sign in to add a comment