Skip to content

Fix DelayValidation and DurationValidation in field tests #3786

Description

@nycrat

Description of the task

The delay and duration validation classes are used to modify other validations, to add a delay or a duration that the validation has to be valid for. However, these validations were implemented using simple logic that assumes each validation check is going to be DEFAULT_SIMULATOR_TICK_RATE_SECONDS_PER_TICK seconds apart. This works fine for only simulated tests, but as we combine field and simulated tests under the same interface, we need support for field tests where each tick's duration is going to be dynamic.

Right now, the duration and delay validations pass super quickly, meaning that the duration of each tick is way faster than 1/60 of a second, which is the value of DEFAULT_SIMULATOR_TICK_RATE_SECONDS_PER_TICK. A possible approach to this issue is the TimeProvider class which is a global singleton that should be the single source of truth for anything related to the time since gameplay has started.

Acceptance criteria

  • DelayValidation and DurationValidation's implementation does not rely on DEFAULT_SIMULATOR_TICK_RATE_SECONDS_PER_TICK
  • The validations behave the same way with field tests, sim tests, and also sim tests with ci_mode

Blocked By

#3744

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssues that describe a bug and possibly a suggested solutionDifficulty - 7Well-defined tasks that require some understanding about the relevant system and toolsTestingField testing, test infrastructure, robot tuningpythonPull requests that update python code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions