Skip to content

test-run-timeout doesn't work on multiprocess plugin #564

Description

@kaichiachen

Hi team,

I upgraded my nose2 to 0.12.0. Here is my unittest.cfg

[unittest]
plugins = nose2.plugins.mp

[multiprocess]
always-on = true
processes = 0
test-run-timeout = 1

I expected it will timeout the testcase if it runs over 1 sec
This is one of my test. I injected 10 secs sleep

    def test_sample(self):
        time.sleep(10)
        with self.assertRaises(ValueError):
            random.sample(self.seq, 20)
        for element in random.sample(self.seq, 5):
            self.assertTrue(element in self.seq)

And try to run nose2

#> nose2 -vvv -s ./example                                                                      
test_shuffle (example.test_example.TestSequenceFunctions) ... ok
test_choice (example.test_example.TestSequenceFunctions) ... ok
test_sample (example.test_example.TestSequenceFunctions) ... ok

----------------------------------------------------------------------
Ran 3 tests in 10.023s

OK

It runs over 1 sec and didn't report error. Could team help to check parameter test-run-timeout still works? thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions