def testPeriodicTargetUpdate(self, use_locking, update_period):
    """Tests that the simple success case works as expected.

    This is an integration test. The periodically and update parts are
    unit-tested in the preceding.

    Args:
      use_locking: value for `periodic_target_update`'s `use_locking` argument.
      update_period: how often an update should happen.
    """
    target_variables = [tf.Variable(tf.zeros([1, 2]))]
    source_variables = [tf.Variable(tf.random_normal([1, 2]))]
    increment = tf.ones([1, 2])

    update_source_op = tf.assign_add(source_variables[0], increment)
    updated = target_update_ops.periodic_target_update(
        target_variables,
        source_variables,
        update_period=update_period,
        use_locking=use_locking)

    with self.test_session() as sess:
      sess.run(tf.global_variables_initializer())

      for step in range(3 * update_period):
        sess.run(update_source_op)
        sess.run(updated)
        targets, sources = sess.run([target_variables, source_variables])

        if step % update_period == 0:
          self.assertAllClose(targets, sources)
        else:
          self.assertNotAllClose(targets, sources)
Tests that the simple success case works as expected.

    This is an integration test. The periodically and update parts are
    unit-tested in the preceding.

    Args:
      use_locking: value for `periodic_target_update`'s `use_locking` argument.
      update_period: how often an update should happen.
    
trfl/target_update_ops_test.py