Skip to content

Instantly share code, notes, and snippets.

View ShaneHarvey's full-sized avatar

Shane Harvey ShaneHarvey

View GitHub Profile
@ShaneHarvey
ShaneHarvey / resync-specs.sh
Last active December 16, 2021 18:42
Resync spec tests for PyMongo
#!/bin/bash
# exit when any command fails
set -e
# Update to match your system.
PYMONGO=~/git/mongo-python-driver
SPECS=~/git/specifications
# Ensure the JSON files are up to date.
cd $SPECS/source
import logging
import time
import threading
from bson import SON
from pymongo import monitoring, MongoClient
from pymongo.server_selectors import writable_server_selector
@ShaneHarvey
ShaneHarvey / launch.py
Last active September 7, 2021 23:21
Very rough python script to start MongoDB clusters using mongo-orchestration
# Copyright 2015 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@ShaneHarvey
ShaneHarvey / client-session-transaction-states.dot
Last active May 18, 2018 18:40
ClientSession transaction states
digraph gc {
rankdir = LR
label = "ClientSession state transitions. 'insert' stands for any operation.
'error' isn't a permanent state, it just represents throwing an error.
"
labelloc = t
initial [shape="rectangle"]