From patchwork Mon Aug 28 11:39:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Kerr X-Patchwork-Id: 806542 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xgqZ46KWcz9sD9 for ; Mon, 28 Aug 2017 21:39:56 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="IHB8oBTH"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3xgqZ44sKFzDqBb for ; Mon, 28 Aug 2017 21:39:56 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="IHB8oBTH"; dkim-atps=neutral X-Original-To: patchwork@lists.ozlabs.org Delivered-To: patchwork@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3xgqYw5W1CzDq75 for ; Mon, 28 Aug 2017 21:39:48 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ozlabs.org header.i=@ozlabs.org header.b="IHB8oBTH"; dkim-atps=neutral Received: by ozlabs.org (Postfix, from userid 1023) id 3xgqYw4T5zz9sN7; Mon, 28 Aug 2017 21:39:48 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ozlabs.org; s=201707; t=1503920388; bh=Xn09vg/bE6dJgFMOR2n5EuVDfCeLiLxeRaZSLD6qFr0=; h=From:To:Subject:Date:From; b=IHB8oBTH/9elNaMz3r3S6JzNpNPKFCGbPkbbqQI7f4+vnlNDvmnNv0qXChoHmuXUZ UHbqrtZB0w3bmwC6p80CfuvY07mSZZ9fZJm8Nh4wcfCwDzLNoy4v7kVf3XDwstd6Ye 4mT8x5PcVXXxB+DWHwK7ePcbFOUm7QplnnbVLguTRKIDSSe7QlE21dgwP6WoNv4ZHO WE4vtbzKM60nXL6F0qqZAr36+h8gxTJxAUtX0nsz02C92pKMLKwAKqzBIw3BTuvcHB ejJEvsZlTeLn6Ih5IXv5XzkB4/VrSnHmmLubNTrLEPRPzBrJbefbzQZxifFLIHNo2i PSIL2EbmoWg7Q== From: Jeremy Kerr To: patchwork@lists.ozlabs.org Subject: [PATCH 1/2] tests: Run FuzzTest within a transaction Date: Mon, 28 Aug 2017 19:39:17 +0800 Message-Id: <1503920358-26652-1-git-send-email-jk@ozlabs.org> X-Mailer: git-send-email 2.7.4 X-BeenThere: patchwork@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Patchwork development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: patchwork-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Patchwork" Currently, the FuzzTests fail for me with: /backends/base/base.py", line 428, in validate_no_broken_transaction "An error occurred in the current transaction. You can't " TransactionManagementError: An error occurred in the current transaction. You can't execute queries until the end of the 'atomic' block. - because the SQL inserts can fail, during an active transaction (the first failure I see is attempting to insert \0 chars in codec-null.mbox); this causes the setup for the next test case to fail. Instead, run each test in its own transaction. Signed-off-by: Jeremy Kerr Reviewed-by: Stephen Finucane --- patchwork/tests/test_parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patchwork/tests/test_parser.py b/patchwork/tests/test_parser.py index 583dfcc..9389f28 100644 --- a/patchwork/tests/test_parser.py +++ b/patchwork/tests/test_parser.py @@ -25,7 +25,7 @@ from email.utils import make_msgid import os import unittest -from django.test import TestCase +from django.test import TestCase, TransactionTestCase from django.utils import six from patchwork.models import Comment @@ -865,7 +865,7 @@ class SubjectTest(TestCase): self.assertEqual(parse_version('Hello, world (V6)', []), 6) -class FuzzTest(TestCase): +class FuzzTest(TransactionTestCase): """Test fuzzed patches.""" def setUp(self): create_project(listid='patchwork.ozlabs.org')