Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
bliss
bliss
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 529
    • Issues 529
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Jira
    • Jira
  • Merge Requests 133
    • Merge Requests 133
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Bliss
  • blissbliss
  • Issues
  • #1735

Closed
Open
Opened Jun 11, 2020 by Wout De Nolf@denolf
  • Report abuse
  • New issue
Report abuse New issue

[flint] test_created_flint broken again

The test we fixed in !2450 (merged) seems to be broken again.

It also fails locally on my machine, with a different exception than CI (see below).

As for the pipeline:

https://gitlab.esrf.fr/bliss/bliss/-/jobs/110267

______________________________ test_created_flint ______________________________

flint_session = <bliss.common.session.Session object at 0x7f1dd4752810>

    def test_created_flint(flint_session):
        """
        Flint is created and attached with subprocess
        """
        flint = plot.get_flint(creation_allowed=False)
    
        # Check messages and stdout
        listener = testutils.TestLogging(proxy.FLINT_OUTPUT_LOGGER.name, info=1)
        with listener:
            flint.ping()
            for _ in range(10):
                if len(listener.records) >= 1:
                    # Early break
                    break
>               time.sleep(0.5)

tests/flint/test_flint_factory.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <TestLogging (NOTSET)>, exc_type = None, exc_value = None
traceback = None

    def __exit__(self, exc_type, exc_value, traceback):
        """Context (i.e., with) support"""
        self.logger.removeHandler(self)
        self.logger.propagate = True
        self.logger.setLevel(self.entry_level)
        self.logger.disabled = self.entry_disabled
    
        count_by_level = self.get_count_by_level()
    
        # Remove keys which does not matter
        ignored = [r for r, v in self.expected_count_by_level.items() if v is None]
        expected_count_by_level = dict(self.expected_count_by_level)
        for i in ignored:
            del count_by_level[i]
            del expected_count_by_level[i]
    
        if count_by_level != expected_count_by_level:
            # Re-send record logs through logger as they where masked
            # to help debug
            message = ""
            for level in count_by_level.keys():
                if message != "":
                    message += ", "
                count = count_by_level[level]
                expected_count = expected_count_by_level[level]
                message += "%d %s (got %d)" % (expected_count, logging.getLevelName(level), count)
    
            raise RuntimeError(
>               'Expected %s' % message)
E           RuntimeError: Expected 1 INFO (got 3)

/opt/conda/envs/testenv/lib/python3.7/site-packages/silx/utils/testutils.py:224: RuntimeError

Locally on my machine:

_______________________________________ ERROR at setup of test_created_flint _______________________________________

xvfb = None, beacon = <bliss.config.static.Config object at 0x7fcb41c53950>

    @pytest.fixture
    def flint_session(xvfb, beacon):
        session = beacon.get("flint")
        session.setup()
>       with flint_context():

tests/conftest.py:520: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
/data/id21/inhouse/wout/dev/virtualenvs/lid21data/bliss_env/lib/python3.7/contextlib.py:112: in __enter__
    return next(self.gen)
tests/conftest.py:501: in flint_context
    flint = plot.get_flint()
bliss/flint/client/proxy.py:421: in get_flint
    FLINT = FlintClient()
bliss/flint/client/proxy.py:60: in __init__
    self.__start_flint()
bliss/flint/client/proxy.py:92: in __start_flint
    self.__attach_flint(process)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <bliss.flint.client.proxy.FlintClient object at 0x7fcb417cf390>
process = <Popen at 0x7fcb417c0fd0 pid=37376 returncode=1>

    def __attach_flint(self, process):
        """Attach a flint process, make a RPC proxy and bind Flint to the current
        session and return the FLINT proxy.
        """
        if isinstance(process, int):
            if not psutil.pid_exists(process):
                raise psutil.NoSuchProcess(
                    process, "Flint PID %s does not exist" % process
                )
            process = psutil.Process(process)
    
        pid = process.pid
        FLINT_LOGGER.debug("Attach flint PID: %d...", pid)
        beacon = get_default_connection()
        redis = beacon.get_redis_connection()
        try:
            session_name = current_session.name
        except AttributeError:
            raise RuntimeError("No current session, cannot attach flint")
    
        # Current URL
        key = config.get_flint_key(pid)
        for _ in range(3):
            value = redis.brpoplpush(key, key, timeout=5)
            if value is not None:
                break
        if value is None:
            raise ValueError(
>               f"flint: cannot retrieve Flint RPC server address from pid '{pid}`"
            )
E           ValueError: flint: cannot retrieve Flint RPC server address from pid '37376`

bliss/flint/client/proxy.py:177: ValueError
Assignee
Assign to
version 1.5.0
Milestone
version 1.5.0
Assign milestone
Time tracking
None
Due date
None
2
Labels
bug flint
Assign labels
  • View project labels
Reference: bliss/bliss#1735