def METHOD_NAME(config, source_app):
    """
    Checks that attempts to add multiple active InstanceConfig records fail.
    InstanceConfig is supposed to be invalidated by setting
    valid_until to the time the config was no longer in effect. Until
    we added the partial index preventing multiple rows with a null
    valid_until, it was possible for the system to create multiple
    active records, which would cause MultipleResultsFound exceptions
    in InstanceConfig.get_current.
    """
    # create a separate session
    engine = create_engine(source_app.config["SQLALCHEMY_DATABASE_URI"])
    session = sessionmaker(bind=engine)()
    # in the separate session, create an InstanceConfig with default
    # values, but don't commit it
    conflicting_config = InstanceConfig()
    session.add(conflicting_config)
    with source_app.app_context():
        # get_current will create another InstanceConfig with default values
        InstanceConfig.get_current()
    # now the commit of the first instance should fail
    with pytest.raises(IntegrityError):
        session.commit()