小编Mut*_*amy的帖子

无法在CentOS 7上启动postgresql服务

无法在CentOS 7上启动postgresql-9.5.

我按照这个页面 - https://wiki.postgresql.org/wiki/YUM_Installation - 在CentOS上安装数据库服务器.

设置后我尝试了同样的方法setenforce 0,但这也没有帮助.

我正在做所有的操作root.

systemctl start postgresql-9.5.service
Job for postgresql-9.5.service failed because the control process exited with error 
code. See "systemctl status postgresql-9.5.service" and "journalctl -xe" for details.
Run Code Online (Sandbox Code Playgroud)

以下是我获得的状态 -

Redirecting to /bin/systemctl status  postgresql-9.5.service
? postgresql-9.5.service - PostgreSQL 9.5 database server
   Loaded: loaded (/usr/lib/systemd/system/postgresql-9.5.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2016-02-18 15:20:30 EST; 2min 28s ago
  Process: 15041 ExecStartPre=/usr/pgsql-9.5/bin/postgresql95-check-db-dir ${PGDATA} (code=exited, status=1/FAILURE)

Feb 18 15:20:30 …
Run Code Online (Sandbox Code Playgroud)

postgresql centos rhel centos7 rhel7

25
推荐指数
2
解决办法
6万
查看次数

Pytest - 如何将参数传递给setup_class?

我有一些代码如下所示.我运行时遇到too few args错误.我没有setup_class明确地调用,所以不确定如何传递任何参数.我试过装饰方法@classmethod,但仍然看到相同的错误.

我看到的错误是 - E TypeError: setup_class() takes exactly 2 arguments (1 given)

需要注意的一点 - 如果我没有将任何参数传递给类,只传递cls,那么我没有看到错误.

任何帮助是极大的赞赏.

在发布之前,我确实在问题#1问题#2中回顾了这些问题.我不明白这些问题的解决方案,或者它们如何运作.

class A_Helper:
    def __init__(self, fixture):
        print "In class A_Helper"

    def some_method_in_a_helper(self):
        print "foo"

class Test_class:
    def setup_class(cls, fixture):
        print "!!! In setup class !!!"
        cls.a_helper = A_Helper(fixture)

    def test_some_method(self):
        self.a_helper.some_method_in_a_helper()
        assert 0 == 0
Run Code Online (Sandbox Code Playgroud)

python pytest

6
推荐指数
2
解决办法
6238
查看次数

带有 spring-boot-maven 插件的 Spring Boot - 运行集成测试后无法重启应用服务器

我有一个 Spring Boot 应用程序,并且该应用程序具有集成测试。

这是我的 pom.xml 中用于运行集成测试的相关片段。

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
      <mainClass>com.xyz.Application</mainClass>
      <executable>true</executable>
      <fork>true</fork>
      <jmxPort>7654</jmxPort>
    </configuration>
    <executions>
      <execution>
        <id>pre-integration-test</id>
        <goals>
          <goal>start</goal>
        </goals>
        <configuration>
          <fork>true</fork>
          <jmxPort>7654</jmxPort>
        </configuration>
      </execution>
      <execution>
        <id>post-integration-test</id>
        <goals>
          <goal>stop</goal>
        </goals>
        <configuration>
          <fork>true</fork>
          <jmxPort>7654</jmxPort>
        </configuration>
      </execution>
    </executions>
  </plugin>
Run Code Online (Sandbox Code Playgroud)

当我运行时mvn verify,我看到单元测试首先运行。然后应用服务器启动,集成测试成功运行。mvn 进程成功退出。

我还在控制台日志中看到以下内容,这让我相信应用程序服务器正在正确关闭 -

[INFO] --- spring-boot-maven-plugin:2.1.1.RELEASE:stop (post-integration-test) @ application ---
[DEBUG] Configuring mojo org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE:stop from plugin realm ClassRealm[plugin>org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE, parent: sun.misc.Launcher$AppClassLoader@42a57993]
[DEBUG] Configuring mojo 'org.springframework.boot:spring-boot-maven-plugin:2.1.1.RELEASE:stop' with basic configurator -->
[DEBUG]   (f) fork = true
[DEBUG]   (f) jmxPort = …
Run Code Online (Sandbox Code Playgroud)

java jmx maven spring-boot spring-boot-maven-plugin

5
推荐指数
1
解决办法
2284
查看次数