Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor connection management in bqjdbc tests #186

Merged
merged 6 commits into from
Jan 4, 2024

Commits on Dec 28, 2023

  1. Refactor BQScrollableResultSetFunctionTest connection management.

    Use common `ConnectionFromResources.connect` method instead of a bespoke
    `NewConnection` method.
    
    Also, use instance variable/test case scoped connections and result sets instead
    of static/suite scoped ones. This should help enable test parallelization
    later. Local testing shows no reliable increase in
    `BQScrollableResultSetFunctionTest` total runtime (~30 seconds
    both before and after change).
    goomrw committed Dec 28, 2023
    Configuration menu
    Copy the full SHA
    28012fa View commit details
    Browse the repository at this point in the history
  2. Refactor BQForwardOnlyResultSetFunctionTest connection management.

    Use common `ConnectionFromResources.connect` method instead of a bespoke
    `NewConnection` method.
    
    Also, use instance variable/test case scoped connections and result sets instead
    of static/suite scoped ones. This should help enable test parallelization
    later. Local testing shows no reliable increase in runtime (~30
    seconds).
    
    This was eased by the introduction of a second BQ connection with
    legacy SQL disabled (`standardSqlConnection`). Not every test uses both
    connections, so this is a little wasteful and risks introducing some
    unreliability, but it isolates test better than continually closing
    and reopening a static connection.
    goomrw committed Dec 28, 2023
    Configuration menu
    Copy the full SHA
    582b761 View commit details
    Browse the repository at this point in the history
  3. Refactor BQResultSetFunctionTest connection management.

    Use common `ConnectionFromResources.connect` method instead of a bespoke
    `NewConnection` method.
    
    Also, use instance variable/test case scoped connections and result sets instead
    of static/suite scoped ones. This should help enable test parallelization
    later. Local testing shows no reliable increase in runtime (~30
    seconds).
    goomrw committed Dec 28, 2023
    Configuration menu
    Copy the full SHA
    3479fdc View commit details
    Browse the repository at this point in the history
  4. Refactor QueryResultTest connection management.

    Use common `ConnectionFromResources.connect` method instead of a bespoke
    `NewConnection` method.
    
    Also, use instance variable/test case scoped connections and result sets instead
    of static/suite scoped ones. This should help enable test parallelization
    later. Local testing shows no reliable increase in runtime (~12
    seconds).
    
    This was eased by the introduction of a second BQ connection with
    legacy SQL disabled (`standardSqlConnection`). Not every test uses both
    connections, so this is a little wasteful and risks introducing some
    unreliability, but it isolates test better than continually closing
    and reopening a static connection.
    goomrw committed Dec 28, 2023
    Configuration menu
    Copy the full SHA
    62f1f38 View commit details
    Browse the repository at this point in the history
  5. Refactor QueryResultTest connection management.

    Use common `ConnectionFromResources.connect` method instead of a bespoke
    `NewConnection` method.
    
    Also, use instance variable/test case scoped connections and result sets instead
    of static/suite scoped ones. This should help enable test parallelization
    later. Local testing shows no reliable increase in total runtime (~6 seconds
    both before and after change).
    goomrw committed Dec 28, 2023
    Configuration menu
    Copy the full SHA
    68f17f5 View commit details
    Browse the repository at this point in the history
  6. Remove extra instance variable fixtures.

    Now each @before method sets a single instance variable.
    This is to address code review comments.
    goomrw committed Dec 28, 2023
    Configuration menu
    Copy the full SHA
    e61041d View commit details
    Browse the repository at this point in the history