fix flaky test that only is flaky on postgres

This commit is contained in:
burnettk 2022-09-20 15:32:43 -04:00
parent a03fef847f
commit e5c363397a
2 changed files with 7 additions and 5 deletions

View File

@ -29,10 +29,10 @@ if [[ "${1:-}" == "clean" ]]; then
if [[ "${SPIFF_DATABASE_TYPE:-}" == "postgres" ]]; then
if ! docker exec -it postgres-spiff psql -U spiffworkflow_backend spiffworkflow_backend_testing -c "select 1"; then
docker run --name postgres-spiff -p 5432:5432 -e POSTGRES_PASSWORD=spiffworkflow_backend -e POSTGRES_USER=spiffworkflow_backend -e POSTGRES_DB=spiffworkflow_backend_testing -d postgres
sleep 4 # classy
# create other db
fi
if ! docker exec -it postgres-spiff psql -U spiffworkflow_backend spiffworkflow_backend_development -c "select 1"; then
# create other db. spiffworkflow_backend_testing came with the docker run.
docker exec -it postgres-spiff psql -U spiffworkflow_backend spiffworkflow_backend_testing -c "create database spiffworkflow_backend_development;"
fi
fi

View File

@ -188,8 +188,10 @@ class TestMessageService(BaseTest):
process_instance_result = ProcessInstanceModel.query.all()
assert len(process_instance_result) == 3
process_instance_receiver_one = process_instance_result[1]
process_instance_receiver_two = process_instance_result[2]
process_instance_receiver_one = ProcessInstanceModel.query.filter_by(process_model_identifier='message_receiver_one').first()
assert process_instance_receiver_one is not None
process_instance_receiver_two = ProcessInstanceModel.query.filter_by(process_model_identifier='message_receiver_two').first()
assert process_instance_receiver_two is not None
# just make sure it's a different process instance
assert (