1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

postgresql CI tests: fix timeouts (#598)

* postgresql CI tests: fix timeouts

* fix

ci_complete
This commit is contained in:
Andrew Klychkov 2020-07-02 10:01:20 +03:00 committed by GitHub
parent e2bd4b34ed
commit 3cde447eb8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 79 additions and 7 deletions

View file

@ -20,11 +20,28 @@
name: wal_level
value: logical
- name: postgresql_slot - restart PostgreSQL
# To avoid CI timeouts
- name: Kill all postgres processes
shell: 'pkill -u {{ pg_user }}'
become: yes
when: ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version == '8'
ignore_errors: yes
- name: postgresql_slot - stop PostgreSQL
become: yes
service:
name: "{{ postgresql_service }}"
state: restarted
state: stopped
- name: postgresql_slot - pause between stop and start PostgreSQL
pause:
seconds: 5
- name: postgresql_slot - start PostgreSQL
become: yes
service:
name: "{{ postgresql_service }}"
state: started
#
# state=present

View file

@ -61,11 +61,28 @@
name: track_functions
value: all
- name: Restart PostgreSQL
# To avoid CI timeouts
- name: Kill all postgres processes
shell: 'pkill -u {{ pg_user }}'
become: yes
when: ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version == '8'
ignore_errors: yes
- name: Stop PostgreSQL
become: yes
service:
name: "{{ postgresql_service }}"
state: restarted
state: stopped
- name: Pause between stop and start PosgreSQL
pause:
seconds: 5
- name: Start PostgreSQL
become: yes
service:
name: "{{ postgresql_service }}"
state: started
- name: Create test functions
<<: *task_parameters

View file

@ -1,3 +1,7 @@
# Exit when Suse because it causes CI problems
- meta: end_play
when: ansible_os_family == 'Suse'
- name: python 2
set_fact:
python_suffix: ''
@ -26,6 +30,12 @@
state: started
when: ansible_service_mgr == 'systemd' and ansible_distribution == 'Fedora'
- name: Kill all postgres processes
shell: 'pkill -u {{ pg_user }}'
become: yes
when: ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version == '8'
ignore_errors: yes
- name: stop postgresql service
service: name={{ postgresql_service }} state=stopped
ignore_errors: true
@ -83,7 +93,16 @@
when: ansible_os_family == 'Debian'
- name: Initialize postgres (Suse)
service: name=postgresql state=restarted
service: name=postgresql state=stopped
when: ansible_os_family == 'Suse'
- name: Pause between stop and start postgresql
pause:
seconds: 5
when: ansible_os_family == 'Suse'
- name: Initialize postgres (Suse)
service: name=postgresql state=started
when: ansible_os_family == 'Suse'
- name: Copy pg_hba into place
@ -153,8 +172,27 @@
- name: start postgresql service
service: name={{ postgresql_service }} state=started
- name: restart postgresql service
service: name={{ postgresql_service }} state=restarted
- name: Pause between start and stop
pause:
seconds: 5
- name: Kill all postgres processes
shell: 'pkill -u {{ pg_user }}'
become: yes
when: ansible_facts.distribution == 'CentOS' and ansible_facts.distribution_major_version == '8'
ignore_errors: yes
register: terminate
- name: Stop postgresql service
service: name={{ postgresql_service }} state=stopped
when: terminate is not succeeded
- name: Pause between stop and start
pause:
seconds: 5
- name: Start postgresql service
service: name={{ postgresql_service }} state=started
- name: copy control file for dummy ext
copy: