From d8615df47f6d8fcbd5f5c342bf5b7d56b9cd15fc Mon Sep 17 00:00:00 2001 From: chris meyers Date: Thu, 17 May 2018 14:29:10 -0400 Subject: [PATCH 1/2] postgres back tests can't do this --- awx/main/tests/functional/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/awx/main/tests/functional/__init__.py b/awx/main/tests/functional/__init__.py index 405018d1a4..262a142790 100644 --- a/awx/main/tests/functional/__init__.py +++ b/awx/main/tests/functional/__init__.py @@ -1,6 +1,7 @@ from django.db import connection from django.db.models.signals import post_migrate from django.apps import apps +from django.conf import settings def app_post_migration(sender, app_config, **kwargs): @@ -17,7 +18,8 @@ def app_post_migration(sender, app_config, **kwargs): ) -post_migrate.connect(app_post_migration, sender=apps.get_app_config('main')) +if settings.DATABASES['default']['ENGINE'] == 'django.db.backends.sqlite3': + post_migrate.connect(app_post_migration, sender=apps.get_app_config('main')) From 4031c888de3b25d8ae4f996562bcac5b48ff37c8 Mon Sep 17 00:00:00 2001 From: chris meyers Date: Thu, 17 May 2018 14:37:32 -0400 Subject: [PATCH 2/2] fork process may finish before cancel callback * The "should we cancel?" callback check is only called while the subprocess (child) is alive. If the child executes quickly, the cancel callback has no chance to run. * call a subprocess that takes longer to run like sleep 2 --- awx/main/tests/unit/expect/test_expect.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/awx/main/tests/unit/expect/test_expect.py b/awx/main/tests/unit/expect/test_expect.py index 3978cb14c5..a43775ad33 100644 --- a/awx/main/tests/unit/expect/test_expect.py +++ b/awx/main/tests/unit/expect/test_expect.py @@ -90,7 +90,7 @@ def test_cancel_callback_error(): extra_fields = {} status, rc = run.run_pexpect( - ['ls', '-la'], + ['sleep', '2'], HERE, {}, stdout,