Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

check test hangs #113

Closed
nicola-lunghi opened this issue Feb 14, 2017 · 3 comments
Closed

check test hangs #113

nicola-lunghi opened this issue Feb 14, 2017 · 3 comments

Comments

@nicola-lunghi
Copy link

CTEST_OUTPUT_ON_FAILURE=1 make test
Running tests...
Test project /home/nicolal/tmp/tests/check/build
    Start 1: check_check

and it hangs in there....

$cd tests/
$ ./check_check
Running suite(s): Fork Sub
100%: Checks: 3, Failures: 0, Errors: 0
/home/nicolal/tmp/tests/check/tests/check_check_fork.c:38:P:Core:test_inc:0: Passed
/home/nicolal/tmp/tests/check/tests/check_check_fork.c:47:P:Core:test_nofork_sideeffects:0: Passed
/home/nicolal/tmp/tests/check/tests/check_check_fork.c:54:P:Core:test_nofork_pid:0: Passed
Running suite(s): Fix Sub
0%: Checks: 1, Failures: 1, Errors: 0
/home/nicolal/tmp/tests/check/tests/check_check_fixture.c:36:S:Fix Sub:unchecked_setup:0: Test failure in fixture
Running suite(s): Check Servant

is something related to timeout???

vim tests/check_check_sub.c

----------------

  s = suite_create("Check Servant");

  tc_simple = tcase_create("Simple Tests");
#if defined(HAVE_FORK) && HAVE_FORK==1
  tc_signal = tcase_create("Signal Tests");
#endif /* HAVE_FORK */
#if TIMEOUT_TESTS_ENABLED && defined(HAVE_FORK) && HAVE_FORK == 1
#if HAVE_DECL_SETENV
  setenv("CK_DEFAULT_TIMEOUT", "6", 1);
  tc_timeout_env_int = tcase_create("Environment Integer Timeout Tests");
  unsetenv("CK_DEFAULT_TIMEOUT");
  setenv("CK_DEFAULT_TIMEOUT", "0.5", 1);
  tc_timeout_env_double = tcase_create("Environment Double Timeout Tests");
  unsetenv("CK_DEFAULT_TIMEOUT");
#endif /* HAVE_DECL_SETENV */
  tc_timeout_default = tcase_create("Default Timeout Tests");
  tc_timeout_usr_int = tcase_create("User Integer Timeout Tests");
  tc_timeout_usr_double = tcase_create("User Double Timeout Tests");
#if HAVE_DECL_SETENV
  setenv("CK_TIMEOUT_MULTIPLIER", "2", 1);
  tc_timeout_scale_int = tcase_create("Timeout Integer Scaling Tests");
  tc_timeout_usr_scale_int = tcase_create("User Integer Timeout Scaling Tests");
  setenv("CK_DEFAULT_TIMEOUT", "6", 1);
  tc_timeout_env_scale_int = tcase_create("Environment Integer Timeout Scaling Tests");
  unsetenv("CK_DEFAULT_TIMEOUT");
  unsetenv("CK_TIMEOUT_MULTIPLIER");

  setenv("CK_TIMEOUT_MULTIPLIER", "0.35", 1);
  tc_timeout_scale_double = tcase_create("Timeout Double Scaling Tests");
  tc_timeout_usr_scale_double = tcase_create("User Double Timeout Scaling Tests");
  setenv("CK_DEFAULT_TIMEOUT", "0.9", 1);
  tc_timeout_env_scale_double = tcase_create("Environment Double Timeout Scaling Tests");
  unsetenv("CK_DEFAULT_TIMEOUT");
  unsetenv("CK_TIMEOUT_MULTIPLIER");
#endif /* HAVE_DECL_SETENV */
#endif /* TIMEOUT_TESTS_ENABLED && defined(HAVE_FORK) */
  tc_limit = tcase_create("Limit Tests");
#if defined(HAVE_FORK) && HAVE_FORK==1
  tc_messaging_and_fork = tcase_create("Msg and fork Tests");
  tc_errors = tcase_create("Check Errors Tests");
  tc_exit_handlers = tcase_create("Check Ignore Exit Handlers");
#endif /* HAVE_FORK */

  suite_add_tcase (s, tc_simple);
                                             
@brarcher
Copy link
Contributor

Part of the unit tests run without emitting any output for a bit, then emit the results of all the tests which were run. How long did you wait for the unit tests to complete? As many of the tests are checking that Check's test timeouts work as expected, the portion where nothing is emitted may be a few minutes. As an example, the last build on Travis-CI which ran on GNU/Linux and used gcc/CMake took 6.5 minutes, where most of the time was spent in unit tests. If the timeout tests are disabled the unit tests run in a matter of seconds. An example of this is the MSVC build on AppVeyor, where the unit tests take less than a second.

@nicola-lunghi
Copy link
Author

Ok thanks sorry my bad :-)

@brarcher brarcher closed this as completed Mar 4, 2017
@ghost
Copy link

ghost commented May 15, 2019

I thought there was something wrong that they just hang... especially seeing they fail instead, with CK_FORK=no:

$ export CK_FORK=no
/home/user/build/1packages/3rarelyused/check/makepkg_pacman/check/src/check 
$ make check
Making check in lib
make[1]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/lib'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/lib'
Making check in src
make[1]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/src'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/src'
Making check in doc
make[1]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/doc'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/doc'
Making check in .
make[1]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check'
make[1]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check'
Making check in checkmk
make[1]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/checkmk'
make  check-TESTS
make[2]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/checkmk'
make[3]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/checkmk'
PASS: test/check_checkmk
============================================================================
Testsuite summary for Check 0.12.0
============================================================================
# TOTAL: 1
# PASS:  1
# SKIP:  0
# XFAIL: 0
# FAIL:  0
# XPASS: 0
# ERROR: 0
============================================================================
make[3]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/checkmk'
make[2]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/checkmk'
make[1]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/checkmk'
Making check in tests
make[1]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/tests'
make  check-TESTS
make[2]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/tests'
make[3]: Entering directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/tests'
FAIL: check_check
FAIL: check_check_export
PASS: test_check_nofork.sh
PASS: test_check_nofork_teardown.sh
FAIL: test_xml_output.sh
FAIL: test_log_output.sh
PASS: test_set_max_msg_size.sh
FAIL: test_tap_output.sh
FAIL: test_output.sh
============================================================================
Testsuite summary for Check 0.12.0
============================================================================
# TOTAL: 9
# PASS:  3
# SKIP:  0
# XFAIL: 0
# FAIL:  6
# XPASS: 0
# ERROR: 0
============================================================================
See tests/test-suite.log
Please report to check-devel at lists dot sourceforge dot net
============================================================================
make[3]: *** [Makefile:1341: test-suite.log] Error 1
make[3]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/tests'
make[2]: *** [Makefile:1449: check-TESTS] Error 2
make[2]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/tests'
make[1]: *** [Makefile:1578: check-am] Error 2
make[1]: Leaving directory '/home/user/build/1packages/3rarelyused/check-git/makepkg_pacman/check/src/check/tests'
make: *** [Makefile:561: check-recursive] Error 1
========================================
   Check 0.12.0: tests/test-suite.log
========================================

# TOTAL: 9
# PASS:  3
# SKIP:  0
# XFAIL: 0
# FAIL:  6
# XPASS: 0
# ERROR: 0

.. contents:: :depth: 2

FAIL: check_check_export
========================

Running suite(s): Fork Sub
100%: Checks: 3, Failures: 0, Errors: 0
check_check_fork.c:38:P:Core:test_inc:0: Passed
check_check_fork.c:47:P:Core:test_nofork_sideeffects:0: Passed
check_check_fork.c:54:P:Core:test_nofork_pid:0: Passed
Running suite(s): Check Servant
FAIL check_check_export (exit status: 1)

FAIL: check_check
=================

Running suite(s): Fork Sub
100%: Checks: 3, Failures: 0, Errors: 0
check_check_fork.c:38:P:Core:test_inc:0: Passed
check_check_fork.c:47:P:Core:test_nofork_sideeffects:0: Passed
check_check_fork.c:54:P:Core:test_nofork_pid:0: Passed
Running suite(s): Fix Sub
0%: Checks: 1, Failures: 1, Errors: 0
check_check_fixture.c:36:S:Fix Sub:unchecked_setup:0: Test failure in fixture
Running suite(s): Check Servant
FAIL check_check (exit status: 1)

FAIL: test_output.sh
====================

Problem with ex_output CK_MINIMAL STDOUT NORMAL
Expected:
Running suite(s): S1
 S2
 XML escape " ' < > & 	 
X� tests
37%: Checks: 8, Failures: 4, Errors: 1
Got:
Running suite(s): S1
FAIL test_output.sh (exit status: 1)

FAIL: test_xml_output.sh
========================

Problem with ex_xml_output
Expected:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://check.sourceforge.net/xml/check_unittest.xslt"?>
<testsuites xmlns="http://check.sourceforge.net/ns">
  <suite>
    <title>S1</title>
    <test result="success">
      <fn>ex_output.c:31</fn>
      <id>test_pass</id>
      <iteration>0</iteration>
      <description>Core</description>
      <message>Passed</message>
    </test>
    <test result="failure">
      <fn>ex_output.c:37</fn>
      <id>test_fail</id>
      <iteration>0</iteration>
      <description>Core</description>
      <message>Failure</message>
    </test>
    <test result="error">
      <fn>ex_output.c:46</fn>
      <id>test_exit</id>
      <iteration>0</iteration>
      <description>Core</description>
      <message>Early exit with return value 1</message>
    </test>
  </suite>
  <suite>
    <title>S2</title>
    <test result="success">
      <fn>ex_output.c:66</fn>
      <id>test_pass2</id>
      <iteration>0</iteration>
      <description>Core</description>
      <message>Passed</message>
    </test>
    <test result="failure">
      <fn>ex_output.c:72</fn>
      <id>test_loop</id>
      <iteration>0</iteration>
      <description>Core</description>
      <message>Iteration 0 failed</message>
    </test>
    <test result="success">
      <fn>ex_output.c:72</fn>
      <id>test_loop</id>
      <iteration>1</iteration>
      <description>Core</description>
      <message>Passed</message>
    </test>
    <test result="failure">
      <fn>ex_output.c:72</fn>
      <id>test_loop</id>
      <iteration>2</iteration>
      <description>Core</description>
      <message>Iteration 2 failed</message>
    </test>
  </suite>
  <suite>
    <title>XML escape &quot; &apos; &lt; &gt; &amp; &#x9; &#xA;X tests</title>
    <test result="failure">
      <fn>ex_output.c:78</fn>
      <id>test_xml_esc_fail_msg</id>
      <iteration>0</iteration>
      <description>description &quot; &apos; &lt; &gt; &amp; &#x9; &#xA;X end</description>
      <message>fail &quot; &apos; &lt; &gt; &amp; &#x9; &#xA;X message</message>
    </test>
  </suite>
</testsuites>
Got:
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="http://check.sourceforge.net/xml/check_unittest.xslt"?>
<testsuites xmlns="http://check.sourceforge.net/ns">
  <suite>
    <title>S1</title>
    <test result="success">
      <fn>ex_output.c:31</fn>
      <id>test_pass</id>
      <iteration>0</iteration>
      <description>Core</description>
      <message>Passed</message>
    </test>
    <test result="failure">
      <fn>ex_output.c:37</fn>
      <id>test_fail</id>
      <iteration>0</iteration>
      <description>Core</description>
      <message>Failure</message>
    </test>
FAIL test_xml_output.sh (exit status: 1)

FAIL: test_log_output.sh
========================

Problem with ex_log_output CK_SILENT LOG NORMAL
Expected:
Running suite S1
ex_output.c:31:P:Core:test_pass:0: Passed
ex_output.c:37:F:Core:test_fail:0: Failure
ex_output.c:46:E:Core:test_exit:0: (after this point) Early exit with return value 1
Running suite S2
ex_output.c:66:P:Core:test_pass2:0: Passed
ex_output.c:72:F:Core:test_loop:0: Iteration 0 failed
ex_output.c:72:P:Core:test_loop:1: Passed
ex_output.c:72:F:Core:test_loop:2: Iteration 2 failed
Running suite XML escape " ' < > & 	 
X� tests
ex_output.c:78:F:description " ' < > & 	 
X� end:test_xml_esc_fail_msg:0: fail " ' < > & 	 
X� message
Results for all suites run:
37%: Checks: 8, Failures: 4, Errors: 1
Got:
Running suite S1
ex_output.c:31:P:Core:test_pass:0: Passed
ex_output.c:37:F:Core:test_fail:0: Failure
FAIL test_log_output.sh (exit status: 1)

FAIL: test_tap_output.sh
========================

Problem with ex_tap_output
Expected:
ok 1 - ex_output.c:Core:test_pass: Passed
not ok 2 - ex_output.c:Core:test_fail: Failure
not ok 3 - ex_output.c:Core:test_exit: Early exit with return value 1
ok 4 - ex_output.c:Core:test_pass2: Passed
not ok 5 - ex_output.c:Core:test_loop: Iteration 0 failed
ok 6 - ex_output.c:Core:test_loop: Passed
not ok 7 - ex_output.c:Core:test_loop: Iteration 2 failed
not ok 8 - ex_output.c:description " ' < > & 	 
X� end:test_xml_esc_fail_msg: fail " ' < > & 	 
X� message
1..8

Got:
ok 1 - ex_output.c:Core:test_pass: Passed
not ok 2 - ex_output.c:Core:test_fail: Failure
FAIL test_tap_output.sh (exit status: 1)


but this issue tells me I'm wrong and I need to wait for 7 mins... :)
oh it took less! only 2mins 57seconds!
all passed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants