aboutsummaryrefslogtreecommitdiff
path: root/libcontextsubscriber/multithreading-tests/stress-test/provider.py
diff options
context:
space:
mode:
Diffstat (limited to 'libcontextsubscriber/multithreading-tests/stress-test/provider.py')
-rwxr-xr-xlibcontextsubscriber/multithreading-tests/stress-test/provider.py42
1 files changed, 0 insertions, 42 deletions
diff --git a/libcontextsubscriber/multithreading-tests/stress-test/provider.py b/libcontextsubscriber/multithreading-tests/stress-test/provider.py
deleted file mode 100755
index 748929a4..00000000
--- a/libcontextsubscriber/multithreading-tests/stress-test/provider.py
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/usr/bin/python
-"""A test provider for the stress testing."""
-
-
-# change registry this often [msec]
-registryChangeTimeout = 2017
-
-
-from ContextKit.flexiprovider import *
-import gobject
-import time
-import os
-
-def update():
- t = time.time()
- dt = int(1000*(t - round(t)))
- gobject.timeout_add(1000 - dt, update)
- v = int(round(t))
- fp.set('test.int', v)
- fp.set('test.int2', v)
- print t
- return False
-
-pcnt = 0
-def chgRegistry():
- global pcnt
- pcnt += 1
- if pcnt % 2:
- print "1 provider"
- os.system('cp 1provider.cdb tmp.cdb; mv tmp.cdb cache.cdb')
- else:
- print "2 providers"
- os.system('cp 2providers.cdb tmp.cdb; mv tmp.cdb cache.cdb')
- return True
-
-
-gobject.timeout_add(1000, update)
-# uncoment this to see the "Bus error" XXX
-gobject.timeout_add(registryChangeTimeout, chgRegistry)
-
-fp = Flexiprovider([INT('test.int'), INT('test.int2')], 'my.test.provider', 'session')
-fp.run()