Skip to content

?length parameter doesn't seem to set timeout #88

@willbarkoff

Description

@willbarkoff

Hi there!

I had a question about the ?length parameter on test_case. I wrote a test that should never complete, and I'm trying to get it to timeout, but it won't. I'm wondering if I'm using the ?length parameter correctly:

let suite =
  "main_test_suite"
  >::: [
         "timeout_test"
         >: test_case ~length:(OUnitTest.Custom_length 1.) (fun _ ->
                let rec call_self_tr n =
                  if n = 0 then 0 else call_self_tr (n + 1)
                in
                assert_equal 1 (call_self_tr 1));
       ]

let _ = run_test_tt_main suite

I think that this test should timeout after 1 second, but this doesn't seem to happen? Is there any documentation that i should be looking at for this parameter, or something that I'm doing wrong? I've taken a look here, but that seems to be pretty much the only documentation that I can find.

Thank you so much!

By the way, I'm using OUnit2 v2.2.4.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions