Skip to content

Conversation

@Jack-LuoHongyi
Copy link

Title: test: make org.apache.gora.hive.store.TestHiveStore deterministic

Summary

  • Type: timing-safe assertion (metastore visibility)
  • Scope: test-only; no production changes
  • Module: gora-hive
  • Test: org.apache.gora.hive.store.TestHiveStore#testAutoCreateSchema

Root Cause
After auto-creating the table, Hive metastore visibility may lag briefly. A direct schemaExists() check immediately after the first write can observe stale metadata.

Fix

  • Move the wait-for-visibility logic into assertAutoCreateSchema only. Poll up to 5 seconds (100 ms interval) with flush() between attempts until schemaExists() is observed, then assert. The timeout balances reliability and runtime overhead.
  • Keep assertSchemaExists as a direct existence check and handle both Employee and WebPage schema names (base tests call assertSchemaExists("WebPage") in DataStoreTestBase#testTruncateSchema).
  • Resolve the schema name via employeeStore.getSchemaName() to remain robust to mapping changes.

Validation

  • Local: executed mvn -pl gora-hive -Dtest=org.apache.gora.hive.store.TestHiveStore#testAutoCreateSchema test
  • Scope: test-only changes; no production impact

Risk
Low. Adds a bounded wait in a single test path; preserves validation semantics.

@Jack-LuoHongyi Jack-LuoHongyi changed the title test: make org.apache.gora.hive.store.TestHiveStore deterministic test: make hive.store.TestHiveStore.testAutoCreateSchema deterministic Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant