Skip to content

Flaky: test_a_sandboxed_bots_commands_run_together_in_its_sandbox wall-clock bound (1.17 s vs 1.1 s) #502

Closed

Description

@lydakis

tests.test_approvals.ApprovalTests.test_a_sandboxed_bots_commands_run_together_in_its_sandbox failed on the runtime job of #499:

File "tests/test_approvals.py", line 360
    self.assertLess(time.monotonic() - started, 1.1)
AssertionError: 1.166603699999996 not less than 1.1

Run: https://github.com/lydakis/agent/actions/runs/41173604715/job/124456494941

#499 changes only sonny/ (the client's welcome portrait), so it can't affect this daemon test. The test checks that commands run concurrently by putting a wall-clock bound on them, and a slow shared runner went 66 ms over that bound.

A fix that keeps what the test is checking: make the claim relative instead of a fixed second count. Either compare the elapsed time with the sum of the commands' sleeps, for example less than 1.5× one sleep and well under two, or record each command's start time and assert that they overlap.

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