mirror of
				https://github.com/bspeice/metrik
				synced 2025-11-03 18:00:51 -05:00 
			
		
		
		
	Test that we can create 10000 Mongo targets simultaneously
This commit is contained in:
		@ -30,4 +30,12 @@ class MongoTargetTest(MongoTest):
 | 
			
		||||
        t.persist(d)
 | 
			
		||||
 | 
			
		||||
        u = MongoTarget(collection, id)
 | 
			
		||||
        assert u.retrieve() == d
 | 
			
		||||
        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)
 | 
			
		||||
		Reference in New Issue
	
	Block a user