Fabric8卡在停止并删除docker容器

时间:2019-04-25 10:32:34

标签: java maven unit-testing docker fabric8

嗨,我有一个小项目,我想测试一些环境变量,因此我使用fabric8来构建和启动docker Postgres并设置了一些环境变量,但是当集成测试运行并通过fabric8时很难停止并删除docker容器,这是我的带有fabric8的pom.xml

        <plugin>
                <groupId>io.fabric8</groupId>
                <artifactId>docker-maven-plugin</artifactId>
                <version>0.30.0</version>
                <configuration>
                    <showLogs>true</showLogs>
                    <images>
                        <image>
                            <name>postgres:alpine</name>
                            <alias>wa</alias>
                            <run>
                                <env>
                                    <POSTGRES_USER>wa</POSTGRES_USER>
                                    <POSTGRES_PASSWORD>wa</POSTGRES_PASSWORD>
                                    <POSTGRES_DB>wa</POSTGRES_DB>
                                </env>
                                <wait>
                                    <log>(?s)database system is ready to accept connections.*database system is ready to accept connections</log>
                                    <time>20000</time>
                                </wait>
                            </run>
                        </image>
                    </images>
                </configuration>
                <executions>
                    <execution>
                        <id>prepare-it-database</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>remove-it-database</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

当这里叫停球时会发生什么

[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 6, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- docker-maven-plugin:0.30.0:stop (remove-it-database) @ chatreminderbot ---
wa> 2019-04-25 10:30:27.960 UTC [1] LOG:  received smart shutdown request
wa> 2019-04-25 10:30:27.965 UTC [1] LOG:  background worker "logical replication launcher" (PID 47) exited with exit code 1
wa> 2019-04-25 10:30:27.965 UTC [42] LOG:  shutting down
wa> 2019-04-25 10:30:28.022 UTC [1] LOG:  database system is shut down

它永远存在于那儿,很奇怪的是,它只发生在它的百分比大约是80%的某些时候

0 个答案:

没有答案