[SERVER-45928] Use correct interface import for cpp_libfuzzer_test.py Created: 03/Feb/20  Updated: 29/Oct/23  Resolved: 04/Feb/20

Status: Closed
Project: Core Server
Component/s: Testing Infrastructure
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Raiden Worley (Inactive) Assignee: Raiden Worley (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Sprint: STM 2020-02-10
Participants:
Linked BF Score: 50

 Comments   
Comment by Robert Guo (Inactive) [ 05/Feb/20 ]

Hi Eric and Arun, sorry to hear you're seeing this error. I have a couple of ideas. But since Raiden and I weren't able to repro this issue, would you mind trying this out locally to see if it helps?

Replace this failing line with the following:

from ..fixtures import interface as fixture_interface

The other thing to try is to upgrade to python 3.7. It looks like you're using 3.6 right now, which is not a supported version. I would highly recommend using the Python from the mongodb toolchain. There's at least one fix for a circular import bug in 3.7 that seems to be relevant here. (We are circular importing resmokelib/utils/)

If neither solution works, I'll try to schedule something to debug the problem face-to-face.

Comment by Eric Cox (Inactive) [ 05/Feb/20 ]

carl.worley Yes, this happens on a fresh master with no changes. I see this with resmoke as well too, and as arun.banala mentioned this is on my Ubuntu machine.

Comment by Arun Banala [ 05/Feb/20 ]

+1. I'm getting the same error when I run the resmoke command. Interestingly this is only happening on my ubuntu machine. The same command works fine on my mac.

Comment by Raiden Worley (Inactive) [ 05/Feb/20 ]

This is pretty odd because this commit got through the commit queue, and lint_clang_format has passed several times in the waterfall since this commit without printing a stack trace, and the linter is working locally for me. 

The stack trace printed above is started by the "import git" command, which is near the top of clang_format.py and is not surrounded by branching logic, so it should happen every time clang_format.py is executed. 

eric.cox does this happen for you regardless of what clang_format.py command you run? And does this happen on master with no other changes?

robert.guo do you have any thoughts on this?

Comment by Eric Cox (Inactive) [ 05/Feb/20 ]

carl.worley I ran the command and cleared the .pyc files and I see the same behavior with the same stacktrace as posted above. Others on query have noticed the same issue.

Comment by Raiden Worley (Inactive) [ 04/Feb/20 ]

eric.cox you may have an old python cache that's executing. Try running this:

find . -name "*.pyc" -type f -delete

Comment by Eric Cox (Inactive) [ 04/Feb/20 ]

I am getting this stack trace after rebasing master. I tracked it down to this commit. Here is the stack trace.

-> % ./buildscripts/clang_format.py format-my 
Traceback (most recent call last):
 File "./buildscripts/clang_format.py", line 35, in <module>
 from buildscripts.linter import git # pylint: disable=wrong-import-position
 File "/home/eric/repos/mongo/buildscripts/linter/git.py", line 10, in <module>
 from buildscripts.resmokelib.utils import globstar
 File "/home/eric/repos/mongo/buildscripts/resmokelib/__init__.py", line 7, in <module>
 from . import reportfile
 File "/home/eric/repos/mongo/buildscripts/resmokelib/reportfile.py", line 6, in <module>
 from .testing import report as _report
 File "/home/eric/repos/mongo/buildscripts/resmokelib/testing/__init__.py", line 3, in <module>
 from . import executor
 File "/home/eric/repos/mongo/buildscripts/resmokelib/testing/executor.py", line 8, in <module>
 from . import hooks as _hooks
 File "/home/eric/repos/mongo/buildscripts/resmokelib/testing/hooks/__init__.py", line 8, in <module>
 from .interface import make_hook
 File "/home/eric/repos/mongo/buildscripts/resmokelib/testing/hooks/interface.py", line 5, in <module>
 from ..testcases import interface as testcase
 File "/home/eric/repos/mongo/buildscripts/resmokelib/testing/testcases/__init__.py", line 8, in <module>
 _autoloader.load_all_modules(name=__name__, path=__path__) # type: ignore
 File "/home/eric/repos/mongo/buildscripts/resmokelib/utils/autoloader.py", line 22, in load_all_modules
 importlib.import_module("." + module, package=name)
 File "/usr/lib/python3.6/importlib/__init__.py", line 126, in import_module
 return _bootstrap._gcd_import(name[level:], package, level)
 File "/home/eric/repos/mongo/buildscripts/resmokelib/testing/testcases/cpp_libfuzzer_test.py", line 7, in <module>
 import buildscripts.resmokelib.testing.fixtures.interface as fixture_interface
AttributeError: module 'buildscripts' has no attribute 'resmokelib'

Comment by Githook User [ 04/Feb/20 ]

Author:

{'name': 'Carl Raiden Worley', 'username': 'aggrand', 'email': 'carl.worley@10gen.com'}

Message: SERVER-45928 Use correct interface import for cpp_libfuzzer_test.py
Branch: master
https://github.com/mongodb/mongo/commit/51af2309a693a71e8842e5f04330df45b9b2538e

Generated at Thu Feb 08 05:10:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.