From d8f32d81289ff6cdd2f9e4b01b59b22555d306c2 Mon Sep 17 00:00:00 2001 From: Bradlee Speice Date: Sat, 3 Sep 2016 09:40:12 -0400 Subject: [PATCH] Test that we can create 10000 Mongo targets simultaneously --- test/targets/test_mongo_target.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/targets/test_mongo_target.py b/test/targets/test_mongo_target.py index 9c00ea0..7fc1779 100644 --- a/test/targets/test_mongo_target.py +++ b/test/targets/test_mongo_target.py @@ -30,4 +30,12 @@ class MongoTargetTest(MongoTest): t.persist(d) u = MongoTarget(collection, id) - assert u.retrieve() == d \ No newline at end of file + assert u.retrieve() == d + + def test_scaling(self): + # There was an issue in the past where creating too many targets + # blew things up because it would allocate threads on construction. + # Make sure we can trivially scale correctly + targets = [MongoTarget('test_collection', i) for i in range(10000)] + + self.assertEqual(len(targets), 10000) \ No newline at end of file