Jenkins 的 Selenium/Xvfb 问题

Jenkins 的 Selenium/Xvfb 问题

我正在努力让 Jenkins 运行 Selenium/Xvfb 来对项目进行一些功能测试。Jenkins 要么会挂起,作业永远无法完成,要么最终因错误而终止。这是使用 Xvfb 插件。这是最近的回溯之一——

======================================================================
ERROR: test_update_yeast_invalid_form_validation (functional_tests.test_simple_yeast_validation_form.YeastFormValidation)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/jenkins/workspace/MyProj/functional_tests/base.py", line 29, in setUp
    self.browser = webdriver.Firefox()
  File "/var/lib/jenkins/shiningpanda/jobs/d4d78946/virtualenvs/d41d8cd9/lib/python3.6/site-packages/selenium/webdriver/firefox/webdriver.py", line 158, in __init__
    keep_alive=True)
  File "/var/lib/jenkins/shiningpanda/jobs/d4d78946/virtualenvs/d41d8cd9/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 154, in __init__
    self.start_session(desired_capabilities, browser_profile)
  File "/var/lib/jenkins/shiningpanda/jobs/d4d78946/virtualenvs/d41d8cd9/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 243, in start_session
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/var/lib/jenkins/shiningpanda/jobs/d4d78946/virtualenvs/d41d8cd9/lib/python3.6/site-packages/selenium/webdriver/remote/webdriver.py", line 311, in execute
    self.error_handler.check_response(response)
  File "/var/lib/jenkins/shiningpanda/jobs/d4d78946/virtualenvs/d41d8cd9/lib/python3.6/site-packages/selenium/webdriver/remote/errorhandler.py", line 237, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Process unexpectedly closed with status 1


----------------------------------------------------------------------
Ran 25 tests in 33.513s

FAILED (errors=19, skipped=6)
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
Destroying test database for alias 'default'...
Build step 'Virtualenv Builder' marked build as failure
Xvfb stopping
unlink: No such file or directory
unlink /var/lib/jenkins/xvfb-30-..fbdir854052494809466199/Xvfb_screen0 failed, Invalid argumentFinished: FAILURE

这可能与 Xvfb 仍在运行的问题有关,即使我终止了该作业也是如此。以下是我的设置:

在构建之前启动 Xvfb,并在构建后将其关闭 = 已选中 Xvfb 特定显示名称 = 99 超时(秒) = 10 Xvfb 显示名称偏移量 = 0 记录 Xvfb 输出 = 已选中

我尝试使用注入环境变量插件添加以下环境变量——DISPLAY=:99.0

我尝试搜索日志,但在 Google 上找不到任何有关日志位置的信息。有人能帮我指出正确的方向吗?

相关内容