Skip to content

Commit a1fe4dd

Browse files
committed
testsuite: test Python KVS more thoroughly
Problem: In python/t0005-kvs.py, the set_and_check_context() function uses the same KVSDir object to write and read a value back. This doesn't ensure that the KVS data was actually commited to the KVS successfully, as the data may just be locally cached in the KVSDir object. Solution: After performing a KVS commit, open a new KVSDir object to ensure the data has been written to the KVS correctly.
1 parent 9274b9c commit a1fe4dd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

t/python/t0005-kvs.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,13 @@ def set_and_check_context(self, key, value, type):
3535
kd = flux.kvs.KVSDir(self.f)
3636
kd[key] = value
3737
kd.commit()
38-
nv = kd[key]
38+
39+
kd2 = flux.kvs.KVSDir(self.f)
40+
nv = kd2[key]
3941
self.assertEqual(value, nv)
4042
self.assertTrue(isinstance(nv, type))
41-
return kd
43+
44+
return kd2
4245

4346
def test_set_int(self):
4447
self.set_and_check_context("int", 10, int)

0 commit comments

Comments
 (0)