我要评分
获取效率
正确性
完整性
易理解

Developer Testing

After porting NebulaGraph to a new system, you can perform developer tests to verify the system compatibility. You are advised to perform a full test or individual tests by referring to this section.

To perform a developer test, specify the test parameter ENABLE_TESTING when running the cmake command.

1
2
3
cd ~/nebula/build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/nebula -DNEBULA_THIRDPARTY_ROOT=~/nebula-third-party-native-build/install -DENABLE_WERROR=OFF -DENABLE_TESTING=ON -DCMAKE_BUILD_TYPE=Release ..
make -j`nproc`

When you use a script to download third-party dependencies, some test cases may fail due to issues such as GCC version mismatch. You are advised to compile the source code of third-party dependencies in the same environment and then import them using the NEBULA_THIRDPARTY_ROOT parameter.

Full Test

Run the following command to perform a full test:

1
ctest -j`nproc` --timeout 400 --output-on-failure

To retest failed test cases without performing a full test, run the following command:

1
ctest -j`nproc` --timeout 400 --output-on-failure --rerun-failed

Individual Tests

Use -R to specify the name of the test case.

1
ctest -j`nproc` --timeout 400 --output-on-failure -R "active_hosts_man_test"

In addition to using ctest for testing, you can directly invoke a file to run a single test case.

1
./bin/test/active_hosts_man_test

Test Description

Some test cases depend on the environment. The details are as follows:

  • When a proxy is used, 0.0.0.0 must be specified for no_proxy/NO_PROXY. Run the following commands before running test cases:
    1
    2
    export no_proxy=127.0.0.1,0.0.0.0,localhost
    export NO_PROXY=127.0.0.1,0.0.0.0,localhost
    
  • Some test cases read the number of CPU cores in the hardware. If the number of CPU cores is too large, the number of started instances might exceed the value specified by id, which is 4096. In this case, the system breaks down. For example, the test cases log_cas_test and log_command_test fail in a 320-core environment, and the test case raft_case_test fails in a 384-core environment.
  • You need to increase the maximum number of open files.
    1
    vim /etc/security/limits.conf
    
    Add the following content to the file.
    1
    2
    3
    4
    * soft nofile 65536
    * hard nofile 65536
    * soft nproc 131072
    * hard nproc 131072