MCPcopy Create free account
hub / github.com/RedisGraph/RedisGraph / test09_fallback

Method test09_fallback

tests/flow/test_timeout.py:225–251  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

223 self.env.assertContains("The query TIMEOUT parameter value cannot exceed the TIMEOUT_MAX configuration parameter value", str(error))
224
225 def test09_fallback(self):
226 self.env.flush()
227 self.env.stop()
228 self.env = Env(decodeResponses=True, moduleArgs="TIMEOUT 1")
229
230 configs = ["TIMEOUT_DEFAULT", "TIMEOUT_MAX"]
231
232 for config in configs:
233 # enable/disable config expecting to fallback to the old timeout
234 redis_con.execute_command("GRAPH.CONFIG", "SET", config, 10)
235 redis_con.execute_command("GRAPH.CONFIG", "SET", config, 0)
236
237 query = "UNWIND range(0,1000000) AS x WITH x AS x WHERE x = 10000 RETURN x"
238 try:
239 # The query is expected to timeout
240 redis_graph.query(query)
241 self.env.assertTrue(False)
242 except ResponseError:
243 self.env.assertTrue(True)
244
245 query = "UNWIND range(0, 1000000) AS x CREATE (:N {v: x})"
246 try:
247 # The query is expected to succeed
248 redis_graph.query(query)
249 self.env.assertTrue(True)
250 except:
251 self.env.assertTrue(False)
252
253 def test10_set_old_timeout_when_new_config_set(self):
254 redis_con.execute_command("GRAPH.CONFIG", "SET", "TIMEOUT_DEFAULT", 10)

Callers

nothing calls this directly

Calls 2

stopMethod · 0.80
queryMethod · 0.45

Tested by

no test coverage detected