print("PASSED TEST STRESSED ROLBACK") def abort_test(self): print("TEST FAILED") sys.exit(1) if __name__ == '__main__': os.system('rm config.txt; touch config.txt') parser = OptionParser() #-m is for the main address, which is a host:port pair, ideally of the #mongos. For non sharded clusters, it can be the primary. parser.add_option("-m", "--main", action="store", type="string", dest="main_addr", default="27217") (options, args) = parser.parse_args() PORTS_ONE['MONGOS'] = options.main_addr s = DocManager('http://localhost:9200', auto_commit=False) s._remove() start_cluster() conn = Connection('localhost:' + PORTS_ONE['MONGOS'], replicaSet="demo-repl") unittest.main(argv=[sys.argv[0]])
for it in a: self.assertTrue('Paul' in it['name']) find_cursor = retry_until_ok(conn['test']['test'].find) self.assertEqual(retry_until_ok(find_cursor.count), NUMBER_OF_DOCS) print("PASSED TEST STRESSED ROLBACK") def abort_test(self): print("TEST FAILED") sys.exit(1) if __name__ == '__main__': os.system('rm config.txt; touch config.txt') parser = OptionParser() #-m is for the main address, which is a host:port pair, ideally of the #mongos. For non sharded clusters, it can be the primary. parser.add_option("-m", "--main", action="store", type="string", dest="main_addr", default="27217") (options, args) = parser.parse_args() PORTS_ONE['MONGOS'] = options.main_addr s = DocManager('http://localhost:9200', auto_commit=False) s._remove() start_cluster() conn = Connection('localhost:' + PORTS_ONE['MONGOS'], replicaSet="demo-repl") unittest.main(argv=[sys.argv[0]])
self.assertEqual(len(a), NUMBER_OF_DOCS) for it in a: self.assertTrue('Paul' in it['name']) find_cursor = retry_until_ok(conn['test']['test'].find) self.assertEqual(retry_until_ok(find_cursor.count), NUMBER_OF_DOCS) print("PASSED TEST STRESSED ROLBACK") def abort_test(self): print("TEST FAILED") sys.exit(1) if __name__ == '__main__': os.system('rm config.txt; touch config.txt') elastic._remove() parser = OptionParser() #-m is for the main address, which is a host:port pair, ideally of the #mongos. For non sharded clusters, it can be the primary. parser.add_option("-m", "--main", action="store", type="string", dest="main_addr", default="27217") (options, args) = parser.parse_args() PORTS_ONE['MONGOS'] = options.main_addr # elastic = DocManager('http://localhost:9200', auto_commit=True) start_cluster() conn = Connection('localhost:' + PORTS_ONE['MONGOS'], replicaSet="demo-repl") unittest.main(argv=[sys.argv[0]])