From e50285b71040dff7c48951f7ba428d29c8f9d424 Mon Sep 17 00:00:00 2001 From: James Lucas Date: Fri, 6 May 2022 16:41:09 -0500 Subject: [PATCH 1/2] Tests: Remove queue overrides / limit test concurrency Ensure all backend variations are properly end-to-end tested by removing in-memory queue override; this currently requires limiting test concurrency to 1 because tests are currently sharing backend services. --- server/run-tests.sh | 2 +- server/svix-server/tests/utils/mod.rs | 7 +------ server/testing-queue.conf | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 server/testing-queue.conf diff --git a/server/run-tests.sh b/server/run-tests.sh index 928d618aa..fca65598a 100755 --- a/server/run-tests.sh +++ b/server/run-tests.sh @@ -2,7 +2,7 @@ # Run tests with various configurations: -TEST_COMMAND="cargo test --all --all-features --all-targets" +TEST_COMMAND="cargo test --all --all-features --all-targets -- --test-threads=1" # Common variables: export DATABASE_URL="postgresql://postgres:postgres@localhost:5432/postgres" diff --git a/server/svix-server/tests/utils/mod.rs b/server/svix-server/tests/utils/mod.rs index 9cb21120b..7c4dee5f1 100644 --- a/server/svix-server/tests/utils/mod.rs +++ b/server/svix-server/tests/utils/mod.rs @@ -212,12 +212,7 @@ pub fn get_default_test_config() -> ConfigurationInner { let _ = dotenv::dotenv(); let cfg = svix_server::cfg::load().unwrap(); - // Change the queue type to in-memory. This is necessary so test workers don't pick up messages - // from other tests whose threads then abort at the end of a test before associated database - // transactions are complete. - let mut cfg = cfg.as_ref().clone(); - cfg.queue_type = svix_server::cfg::QueueType::Memory; - cfg + cfg.as_ref().clone() } pub fn start_svix_server() -> (TestClient, tokio::task::JoinHandle<()>) { diff --git a/server/testing-queue.conf b/server/testing-queue.conf new file mode 100644 index 000000000..8ff3d61e6 --- /dev/null +++ b/server/testing-queue.conf @@ -0,0 +1,17 @@ +include classpath("application.conf") + +queues { + testing { + defaultVisibilityTimeout = 10 seconds + delay = 0 seconds + receiveMessageWait = 0 seconds + deadLettersQueue { + name = "testing-dead-letters" + maxReceiveCount = 100 + } + fifo = false + contentBasedDeduplication = false + } + testing-dead-letters { } + +} From f507ad0846d1e3bedff8b36984c220de6c33572d Mon Sep 17 00:00:00 2001 From: James Lucas Date: Fri, 6 May 2022 17:02:03 -0500 Subject: [PATCH 2/2] fixup! Tests: Remove queue overrides / limit test concurrency --- server/testing-queue.conf | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 server/testing-queue.conf diff --git a/server/testing-queue.conf b/server/testing-queue.conf deleted file mode 100644 index 8ff3d61e6..000000000 --- a/server/testing-queue.conf +++ /dev/null @@ -1,17 +0,0 @@ -include classpath("application.conf") - -queues { - testing { - defaultVisibilityTimeout = 10 seconds - delay = 0 seconds - receiveMessageWait = 0 seconds - deadLettersQueue { - name = "testing-dead-letters" - maxReceiveCount = 100 - } - fifo = false - contentBasedDeduplication = false - } - testing-dead-letters { } - -}