summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoan Touzet <wohali@apache.org>2018-11-13 16:42:23 -0500
committerJoan Touzet <wohali@apache.org>2018-11-13 16:42:23 -0500
commit375853cca38d127260f62127c15eb985c903d500 (patch)
tree585ae4f05858a4e3f8f4f385d3138b78b3b67153
parentb5684968068a22ed35b4fed0e93eda06a48bb7a4 (diff)
downloadcouchdb-375853cca38d127260f62127c15eb985c903d500.tar.gz
Mango test suite Windows fixes, closes #1732
Unfortuantely, os:timestamp() on Windows only has millisecond accuracy. That means that the two Mango tests checking for a positive value of execution_time fail, since these tests appear to be running in <1ms on my test setup (a rather anemic Windows VM!) This change disables only the check for execution_time in two tests, and leaves the remainder of the execution_stats checks in place on Windows. It also introduces a convenience "make.cmd" file so you can "make check" without typing "make -f Makefile.win check" all the time.
-rw-r--r--Makefile.win2
-rw-r--r--make.cmd3
-rw-r--r--src/mango/test/15-execution-stats-test.py11
3 files changed, 14 insertions, 2 deletions
diff --git a/Makefile.win b/Makefile.win
index d0305e25a..f0bc0f77e 100644
--- a/Makefile.win
+++ b/Makefile.win
@@ -119,6 +119,8 @@ check: all
@$(MAKE) -f Makefile.win test-cluster-without-quorum
@$(MAKE) -f Makefile.win eunit
@$(MAKE) -f Makefile.win javascript
+ @$(MAKE) -f Makefile.win mango-test
+# @$(MAKE) -f Makefile.win elixir
.PHONY: eunit
diff --git a/make.cmd b/make.cmd
new file mode 100644
index 000000000..bf8677898
--- /dev/null
+++ b/make.cmd
@@ -0,0 +1,3 @@
+@ECHO OFF
+
+make.exe -f Makefile.win %*
diff --git a/src/mango/test/15-execution-stats-test.py b/src/mango/test/15-execution-stats-test.py
index 6b7408b8b..92a599519 100644
--- a/src/mango/test/15-execution-stats-test.py
+++ b/src/mango/test/15-execution-stats-test.py
@@ -12,6 +12,7 @@
import mango
+import os
import unittest
class ExecutionStatsTests(mango.UserDocsTests):
@@ -23,7 +24,10 @@ class ExecutionStatsTests(mango.UserDocsTests):
self.assertEqual(resp["execution_stats"]["total_docs_examined"], 3)
self.assertEqual(resp["execution_stats"]["total_quorum_docs_examined"], 0)
self.assertEqual(resp["execution_stats"]["results_returned"], 3)
- self.assertGreater(resp["execution_stats"]["execution_time_ms"], 0)
+ # See https://github.com/apache/couchdb/issues/1732
+ # Erlang os:timestamp() only has ms accuracy on Windows!
+ if os.name != 'nt':
+ self.assertGreater(resp["execution_stats"]["execution_time_ms"], 0)
def test_no_execution_stats(self):
resp = self.db.find({"age": {"$lt": 35}}, return_raw=True, executionStats=False)
@@ -36,7 +40,10 @@ class ExecutionStatsTests(mango.UserDocsTests):
self.assertEqual(resp["execution_stats"]["total_docs_examined"], 0)
self.assertEqual(resp["execution_stats"]["total_quorum_docs_examined"], 3)
self.assertEqual(resp["execution_stats"]["results_returned"], 3)
- self.assertGreater(resp["execution_stats"]["execution_time_ms"], 0)
+ # See https://github.com/apache/couchdb/issues/1732
+ # Erlang os:timestamp() only has ms accuracy on Windows!
+ if os.name != 'nt':
+ self.assertGreater(resp["execution_stats"]["execution_time_ms"], 0)
def test_results_returned_limit(self):
resp = self.db.find({"age": {"$lt": 35}}, limit=2, return_raw=True, executionStats=True)