mirror of
https://bitbucket.org/atlassian-docker/docker-atlassian-confluence-server.git
synced 2024-08-30 18:22:16 +00:00
DCD-545: Add incremental check for target process.
This commit is contained in:
parent
b2febfa379
commit
53d71a4ed1
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1,3 @@
|
||||
__pycache__/
|
||||
Pipfile
|
||||
Pipfile.lock
|
||||
|
@ -21,6 +21,21 @@ def get_fileobj_from_container(container, filepath):
|
||||
file = tar.extractfile(filename)
|
||||
return file
|
||||
|
||||
def get_procs(container):
|
||||
ps = container.exec_run('ps aux')
|
||||
return ps.output.decode().split('\n')
|
||||
|
||||
def wait_for_proc(container, proc_str, max_wait=10):
|
||||
waited = 0
|
||||
while waited < max_wait:
|
||||
procs = list(filter(lambda p: proc_str in p, get_procs(container)))
|
||||
if len(procs) > 0:
|
||||
return procs[0]
|
||||
time.sleep(0.1)
|
||||
waited += 0.1
|
||||
|
||||
raise RuntimeError("Failed to find target process")
|
||||
|
||||
|
||||
# def test_server_xml_defaults(docker_cli, image):
|
||||
# container = docker_cli.containers.run(image, detach=True)
|
||||
@ -107,10 +122,8 @@ def test_jvm_args(docker_cli, image):
|
||||
'JVM_SUPPORT_RECOMMENDED_ARGS': '-verbose:gc',
|
||||
}
|
||||
container = docker_cli.containers.run(image, environment=environment, detach=True)
|
||||
time.sleep(0.5) # JVM doesn't start immediately when container runs
|
||||
procs = container.exec_run('ps aux')
|
||||
procs_list = procs.output.decode().split('\n')
|
||||
jvm = [proc for proc in procs_list if '-Dconfluence.home' in proc][0]
|
||||
jvm = wait_for_proc(container, "org.apache.catalina.startup.Bootstrap")
|
||||
|
||||
assert f'-Xms{environment.get("JVM_MINIMUM_MEMORY")}' in jvm
|
||||
assert f'-Xmx{environment.get("JVM_MAXIMUM_MEMORY")}' in jvm
|
||||
assert environment.get('JVM_SUPPORT_RECOMMENDED_ARGS') in jvm
|
||||
@ -131,4 +144,3 @@ def test_first_run_state(docker_cli, image):
|
||||
return
|
||||
time.sleep(1)
|
||||
raise TimeoutError
|
||||
|
Loading…
Reference in New Issue
Block a user