From 613d16dd6c55a75d09d24e4d73ee322e0ce42fea Mon Sep 17 00:00:00 2001 From: David Cook Date: Thu, 8 Aug 2024 14:18:47 -0500 Subject: [PATCH] Use tmpfs in database container (#3360) --- aggregator_core/src/datastore/test_util.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aggregator_core/src/datastore/test_util.rs b/aggregator_core/src/datastore/test_util.rs index 084058a73..f79074632 100644 --- a/aggregator_core/src/datastore/test_util.rs +++ b/aggregator_core/src/datastore/test_util.rs @@ -24,7 +24,7 @@ use std::{ thread::JoinHandle, time::Duration, }; -use testcontainers::{runners::AsyncRunner, ContainerRequest, ImageExt}; +use testcontainers::{core::Mount, runners::AsyncRunner, ContainerRequest, ImageExt}; use tokio::{ io::{AsyncBufRead, AsyncBufReadExt}, join, spawn, @@ -85,6 +85,7 @@ impl EphemeralDatabase { // Start an instance of Postgres running in a container. let db_container = ContainerRequest::from(Postgres::default()) .with_cmd(Self::postgres_configuration(&configuration)) + .with_mount(Mount::tmpfs_mount("/var/lib/postgresql/data")) .start() .await .unwrap();