beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkff <>
Subject [GitHub] incubator-beam pull request #1011: Support for @Setup and @Teardown in DoFnT...
Date Tue, 27 Sep 2016 00:45:37 GMT
GitHub user jkff opened a pull request:

    Support for @Setup and @Teardown in DoFnTester

    - To allow testing DoFn reuse, adds a third cloning mode - CLONE_ONCE. The current CLONE
is renamed to CLONE_PER_BUNDLE because it corresponds to the olden ways of DoFnTester. This
rename should be harmless because it was the default, so probably nobody uses it (nobody uses
it in the Beam codebase anyway), but I can rename it back if necessary.
    - Calls Setup lazily on the first interaction with the fn under test: depending on cloning
mode, this is either a per-bundle clone, or the original fn, or a single clone of the original
    - Calls Teardown either when the DoFnTester is closed, or when finishBundle'ing with CLONE_PER_BUNDLE.
    - Enforces that you have to configure the DoFnTester (setSideInputs, setCloningBehavior)
before using it, to simplify the semantics. Makes setSideInputs consistent with setSideInput(without
"s") in not resetting the state.
    - Allows processing a bundle after processing an element. This used to be disallowed,
but it's weird, because processing a bundle after processing a bundle *was* allowed.
    Additionally, improves testing coverage.

You can merge this pull request into a Git repository by running:

    $ git pull do-fn-tester-lifecycle

Alternatively you can review and apply these changes as the patch at:

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1011
commit 62ec3ed9bfa0bb94c41b0df4761d5d50cb4d196a
Author: Eugene Kirpichov <>
Date:   2016-09-26T23:58:20Z

    Support for @Setup and @Teardown in DoFnTester


If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at or file a JIRA ticket
with INFRA.

View raw message