def test_func(context):
    """
    OCID thread function for testing purposes.

    Parameters
    ----------
    context : dict
        The thread context.

    Returns
    -------
    dict
        The new context.
    """
    if 'fname' not in context:
        raise ValueError("fname must be defined in the context")
    if 'counter' not in context:
        raise ValueError("counter must be defined in the context")
    with open(context['fname'], "w+") as f:
        f.write("hello %d\n" % context['counter'])
    context['counter'] += 1
    return context