Skip to content

[Bug] test: fix silent skip anti-pattern in test_gremlin.py setUpClass probe #327

@Muawiya-contact

Description

@Muawiya-contact

Bug Type (问题类型)

None

Before submit

  • I had searched in the issues and found no similar issues.

Environment (环境信息)


Environment

Item Detail
Module python-client
File hugegraph-python-client/src/tests/test_gremlin.py
Affected Lines L41–52 (setUpClass)

Expected & Actual behavior (期望与实际表现)

Expected & Actual Behavior

Problem

The skip_gremlin_tests probe inside setUpClass (L41–52) silently skips all 6 Gremlin integration tests whenever the Gremlin endpoint returns a 404, times out, or raises a connection error.

This is a silent-skip anti-pattern: a future regression would surface in CI as 6 skipped rather than 6 failed, making it invisible to reviewers and breaking the reliability of the test suite.

Expected

Any connectivity or response failure during the probe should fail loudly — the same principle applied to the auth probe fix in #325.

Actual

The probe swallows 404 / timeout / connection error and marks the entire class as skipped via unittest.skip, hiding real failures behind a green (skipped) status.


Suggested Fix

Two equivalent options:

Option A — Drop the probe entirely

Remove skip_gremlin_tests and let the first test fail naturally if the endpoint is unavailable. This is the simplest fix and mirrors standard integration-test practice.

Option B — Convert the 404 branch to AssertionError

# Before (silent skip)
except (ConnectionError, Timeout, HTTPError):
    raise unittest.SkipTest("Gremlin endpoint unavailable")

After (loud failure)

except (ConnectionError, Timeout, HTTPError) as e:
raise AssertionError(
f"Gremlin endpoint probe failed — endpoint may be down or misconfigured: {e}"
)

Either option ensures regressions surface as failures, not silent skips.


Related Issues


Labels

test python-client

Vertex/Edge example (问题点 / 边数据举例)

Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions