Skip to content

Mock the time clock for better testing. #1113

Closed

Description

@openinx

Currently, we simply use the System.sleep(1000) to help the temporary credentials to be expired, while this would introduce potential issues:

  1. If the unit test or integration test hung for serveral seconds ( such as GC or something). It's easy to produce this test to be flaky one.
  2. It's hard for us to make the integrated and end-to-end test, assume we want to simulate the credential expiration and assert we are using the correct credential in such a complex spark job with spark standalone cluster, OSS unity catalog standalone server, OSS delta/parquet tables. With so many complex variables, every one is possible to hung the whole process, then it's impossible for us to design the integration e2e test via the System.sleep(...).

In this comment, @tdas also said it's better to mock the time clock, for better testing purposes.

#1098 (comment)

So I opened this issue, and let's try to open a pull request to mock the clock.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions