@@ -406,4 +406,54 @@ test_expect_success 'kvs: no pending requests at end of tests' '
406406 test $pendingcount -eq 0
407407'
408408
409+ #
410+ # test transaction-max-ops
411+ #
412+
413+ test_expect_success ' configure illegal transaction-max-ops' '
414+ test_must_fail flux config load <<-EOF
415+ [kvs]
416+ transaction-max-ops = "foobar"
417+ EOF
418+ '
419+
420+ test_expect_success ' configure bad transaction-max-ops' '
421+ test_must_fail flux config load <<-EOF
422+ [kvs]
423+ transaction-max-ops = 0
424+ EOF
425+ '
426+
427+ test_expect_success ' configure small transaction-max-ops' '
428+ flux exec flux config load <<-EOF
429+ [kvs]
430+ transaction-max-ops = 3
431+ EOF
432+ '
433+
434+ # N.B. flux kvs put will place each key=val on command line into 1
435+ # transaction
436+
437+ test_expect_success ' kvs: txns of small size work' '
438+ flux kvs put test.a=1 &&
439+ flux kvs put test.b=1 test.c=1 &&
440+ flux kvs put test.d=1 test.e=1 test.f=1
441+ '
442+
443+ test_expect_success ' kvs: txns of small size work (not rank 0)' '
444+ flux exec -r 1 flux kvs put test.a=1 &&
445+ flux exec -r 1 flux kvs put test.b=1 test.c=1 &&
446+ flux exec -r 1 flux kvs put test.d=1 test.e=1 test.f=1
447+ '
448+
449+ test_expect_success ' kvs: txns above limit fail' '
450+ test_must_fail flux kvs put test.a=2 test.b=2 test.c=2 test.d=2 2> fence1.err &&
451+ grep "Argument list too long" fence1.err
452+ '
453+
454+ test_expect_success ' kvs: txns above limit fail (not rank 0)' '
455+ test_must_fail flux exec -r 1 flux kvs put test.a=3 test.b=3 test.c=3 test.d=3 2> fence2.err &&
456+ grep "Argument list too long" fence2.err
457+ '
458+
409459test_done
0 commit comments