59 Commits

Author SHA1 Message Date
Noah Levitt
c5b1b0a620 fail after 20 "recoverable" exception in iterator
it turns out that when iterating over results sometimes (always?) errors
that are recoverable when running a query are not recoverable, so we've
been ending up in infinite loops
2018-09-27 12:56:30 -07:00
Noah Levitt
f347407c5b making tests work better and pass
but not in python 2.7. mock.MagicMock is not an iterator there
apparently :(
2018-09-17 13:24:59 -07:00
Noah Levitt
95c4cff838 test rethinker error handling, exposing fact that
recoverable errors that happen while iterating over results are not
caught
2018-09-17 11:58:44 -07:00
Noah Levitt
efa01d40ac test exposing dumb bug 2018-03-22 16:00:44 -07:00
Noah Levitt
c02c4b7d2c new api parse_rethinkdb_url() 2017-10-09 17:22:26 -07:00
James Kafader
e1b4153712 clean up small items, typos, change command name, clean up tests in re: exit code testing. 2017-10-03 16:13:42 -07:00
James Kafader
df7c0b8e32 added tests for purging stale services and minimal tests for command line tool 2017-10-03 14:38:31 -07:00
James Kafader
dd5b2122cf improve the git diff here so this runs 2017-10-03 13:56:52 -07:00
James Kafader
a57b4484d3 initial (failing) version of tests file for CLI, changes to CLI to get it minimally working 2017-10-03 13:56:32 -07:00
Noah Levitt
492c97ad31 have test expose bug in unique_service() 2017-05-26 14:48:18 -07:00
Noah Levitt
03e9d4eeef Merge branch 'master' into rename-heartbeat-interval-to-ttl
* master:
  bump version for pull request just merged and tweak run-tests.sh
  avoid database transaction to get current time
  make sure this variable is actually defined
  correct comment
  standardize the concept of 'now' to ensure that the same view of the service is returned from the read and update queries.
2017-05-17 12:15:44 -07:00
Noah Levitt
20857c4e7a bump version for pull request just merged and tweak run-tests.sh 2017-05-17 12:13:10 -07:00
James Kafader
e1b9451a6c forgot to multiply the constants by 3 2017-05-16 18:02:03 -07:00
James Kafader
6dc3967bd6 rename "heartbeat_interval" -> "ttl", simplify mathematics. 2017-05-16 14:31:39 -07:00
James Kafader
501ec1ff23 Adds more unique service tests 2017-05-01 13:35:09 -07:00
Noah Levitt
b85566c405 rename ServiceRegistry.leader() to ServiceRegistry.unique_service(); implement heartbeat in that method; only return healthy service; add a detailed docstring 2017-04-28 16:29:00 -07:00
Noah Levitt
a1c5a08790 raise exception if heartbeat status_info is missing required fields 2017-04-27 14:34:07 -07:00
James Kafader
a5cac606fa added a leader election feature and tests 2017-04-18 16:56:53 -07:00
Noah Levitt
2f01252c32 change logic of orm constructor so that initial values are not considered updates, and explain a bit in the docstring 2017-03-23 18:19:13 -07:00
Noah Levitt
7b17ed1057 turns out we want populate_defaults to happen in __init__, fix so things work right 2017-03-07 17:46:48 -08:00
Noah Levitt
3fd2e5cf60 new method on orm class populate_defaults(), which runs at the beginning of save(), since populating them in __init__() is problematic 2017-03-07 12:44:52 -08:00
Noah Levitt
07bc01cbbd have Document.load() return None if no such doc is found in the db 2017-03-02 10:31:29 -08:00
Noah Levitt
aa177f94b8 split tests into different source files 2017-03-02 10:16:41 -08:00
Noah Levitt
246dfb5b7e new orm class method table_ensure 2017-03-01 11:40:12 -08:00
Noah Levitt
c14bae6050 new convention, call Rethinker object rr (mnemonic RethinkeR, or *double*[think]), leave rethinkdb as r per the rethinkdb convention 2017-03-01 11:20:27 -08:00
Noah Levitt
536bf8d1d8 implement or explicitly disallow other top-level dict operations on ORM Document, and add more automated tests 2017-02-28 17:56:44 -08:00
Noah Levitt
e8db41763b rename the project "doublethink" (credit goes to @adam-miller) 2017-02-28 16:44:26 -08:00
Noah Levitt
4a9978fc46 make ORM __getattr___ return None if attribute is missing; documentation improvements 2017-02-28 16:42:57 -08:00
Noah Levitt
ad0e1b1fd7 rename Document.get to Document.load to avoid masking dict.get 2017-02-24 16:52:59 -08:00
Noah Levitt
abdecc46b8 better smarter ORM with more tests 2017-02-23 16:07:14 -08:00
Noah Levitt
d76e219e7b make run-tests.sh work with the docker image that gets pulled in now, which doesn't have a 'python3.4' command 2017-02-21 16:30:29 -08:00
Noah Levitt
000e4d9cf6 playing with simple ORM thing 2017-02-17 17:23:53 -08:00
Noah Levitt
9c3439dfc5 add apache license file and some license headers 2016-10-31 15:39:12 -07:00
Noah Levitt
82faefde56 catch a failed service registry heartbeat, with unit test 2016-10-31 15:29:46 -07:00
Noah Levitt
2e76c1e570 fixes to make Dockerfile work with latest phusion/baseimage 2016-10-31 15:28:43 -07:00
Noah Levitt
8745d5b6b7 fix tests, including adjusting the timing to make tests pass more consistently 2016-04-19 20:17:22 +00:00
Noah Levitt
f9169321a6 add some tests for available_services() 2016-04-19 19:24:33 +00:00
Noah Levitt
073c1fb578 some fixes to make the tests pass 2015-11-17 20:38:10 +00:00
Noah Levitt
82d3ef45a0 run-tests.sh: clone rethinstuff source directory to temporary location (probably better solution than creating user with matching uid, setting PYTHONDONTWRITEBYTECODE, etc) 2015-11-17 20:08:18 +00:00
Noah Levitt
447f23615f convenience function rethinstuff.utcnow() 2015-11-17 20:06:51 +00:00
Noah Levitt
287258e104 add method available_services to ServiceRegistry, returns all services considered up for the supplied role 2015-11-06 23:42:06 +00:00
Noah Levitt
345348fa46 set PYTHONDONTWRITEBYTECODE in one place 2015-11-06 23:40:03 +00:00
Noah Levitt
a0f5c4870f add pid and first_heartbeat to service registry automatically 2015-11-02 21:20:46 +00:00
Noah Levitt
46a54357ad return whole updated status_info dict from ServiceRegistry.heartbeat() 2015-10-31 00:33:06 +00:00
Noah Levitt
1f64ad84d6 match outer uid within docker container, to avoid ownership/permissions issues with mounted volumes 2015-10-30 19:53:20 +00:00
Noah Levitt
5570ca9241 service registry, with unit tests! 2015-10-30 19:50:33 +00:00
Noah Levitt
7c7b0dc991 Revert "does it still hang if we don't really run anything inside docker?"
This reverts commit e1474133b638e1f442b812ee794a79b6038f6a69.

Conflicts:
	tests/run-tests.sh
2015-10-06 00:57:15 +00:00
Noah Levitt
f4fb551d95 does it still hang with docker run -i? 2015-10-02 17:46:08 +00:00
Noah Levitt
c124507c15 does it still hang if we pipe in /dev/null to stdin? 2015-10-02 17:11:00 +00:00
Noah Levitt
e1474133b6 does it still hang if we don't really run anything inside docker? 2015-10-02 16:55:11 +00:00