Search Unity

Freezes when running StandaloneLinux64 tests in container

Discussion in 'Testing & Automation' started by jilleJr, Nov 24, 2019.

  1. jilleJr

    jilleJr

    Joined:
    Jan 21, 2015
    Posts:
    63
    Trying to run some tests in a Docker container using Unity Test Framework (docs.unity3d.com/Packages/com.unity.test-framework@1.1).
    Running playmode & editmode tests works marvels . However my success stopped when trying to run the tests as a standalone inside the Linux docker image gableroux/unity3d.

    Environment and versions

    Code (yml):
    1.  
    2. # Just using YAML syntax for the aesthetic
    3. Docker image: gableroux/unity3d:2019.2.11f1
    4. docker-machine: version 0.16.1, build cce350d7
    5. Docker: version 19.03.1, build 74b1e89e8a
    6. OS: Windows 10 Home (version 1903)
    7.  
    8. VirtualBox:
    9.   System:
    10.     RAM: 4096 MB
    11.     Processors: 3
    12.     Execution Cap: 100%
    13.   Shared Folders:
    14.     Machine Folders:
    15.     - /c/Projekt  <->  C:\Projekt (Auto-mount: yes, Access: Full)
    16.  
    Code (csharp):
    1.  
    2. Host Name:                 DESKTOP-SCBQIBG
    3. OS Name:                   Microsoft Windows 10 Home
    4. OS Version:                10.0.18362 N/A Build 18362
    5. OS Manufacturer:           Microsoft Corporation
    6. OS Configuration:          Standalone Workstation
    7. OS Build Type:             Multiprocessor Free
    8. Registered Owner:          kalle
    9. Registered Organization:
    10. Product ID:                00325-95800-00000-AAOEM
    11. Original Install Date:     2019-11-09, 14:31:13
    12. System Boot Time:          2019-11-10, 02:10:05
    13. System Manufacturer:       Dell Inc.
    14. System Model:              XPS 13 9370
    15. System Type:               x64-based PC
    16. Processor(s):              1 Processor(s) Installed.
    17.                            [01]: Intel64 Family 6 Model 142 Stepping 10 GenuineIntel ~1792 Mhz
    18. BIOS Version:              Dell Inc. 1.4.0, 2018-05-25
    19. Windows Directory:         C:\WINDOWS
    20. System Directory:          C:\WINDOWS\system32
    21. Boot Device:               \Device\HarddiskVolume2
    22. System Locale:             sv;Svenska
    23. Input Locale:              sv;Svenska
    24. Time Zone:                 (UTC+01:00) Amsterdam, Berlin, Bern, Rom, Stockholm, Wien
    25. Total Physical Memory:     16 192 MB
    26. Available Physical Memory: 5 154 MB
    27. Virtual Memory: Max Size:  19 136 MB
    28. Virtual Memory: Available: 6 504 MB
    29. Virtual Memory: In Use:    12 632 MB
    30. Page File Location(s):     C:\pagefile.sys
    31. Domain:                    WORKGROUP
    32. Logon Server:              \\DESKTOP-SCBQIBG
    33. Hotfix(s):                 5 Hotfix(s) Installed.
    34.                            [01]: KB4515871
    35.                            [02]: KB4519573
    36.                            [03]: KB4516115
    37.                            [04]: KB4521863
    38.                            [05]: KB4517389
    39. Network Card(s):           4 NIC(s) Installed.
    40.                            [01]: Killer Wireless-n/a/ac 1435 Wireless Network Adapter
    41.                                  Connection Name: Wi-Fi
    42.                                  DHCP Enabled:    Yes
    43.                                  DHCP Server:     192.168.8.1
    44.                                  IP address(es)
    45.                                  [01]: 192.168.8.108
    46.                                  [02]: fe80::89be:2203:65a5:e3a7
    47.                            [02]: Bluetooth Device (Personal Area Network)
    48.                                  Connection Name: Bluetooth-nätverksanslutning
    49.                                  Status:          Media disconnected
    50.                            [03]: VirtualBox Host-Only Ethernet Adapter
    51.                                  Connection Name: VirtualBox Host-Only Network
    52.                                  DHCP Enabled:    No
    53.                                  IP address(es)
    54.                                  [01]: 192.168.56.1
    55.                                  [02]: fe80::d81b:4a4d:bc98:76a7
    56.                            [04]: VirtualBox Host-Only Ethernet Adapter
    57.                                  Connection Name: VirtualBox Host-Only Network #2
    58.                                  DHCP Enabled:    No
    59.                                  IP address(es)
    60.                                  [01]: 192.168.99.1
    61.                                  [02]: fe80::4d:8c98:3d96:42b4
    62. Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
    63.                            Virtualization Enabled In Firmware: Yes
    64.                            Second Level Address Translation: Yes
    65.                            Data Execution Prevention Available: Yes
    66.  

    Code (csharp):
    1.  
    2. $ uname -a
    3. Linux 995ad692d89b 4.14.150-boot2docker #1 SMP Sat Oct 19 21:57:02 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
    4.  
    5. $ lscpu
    6. Architecture: x86_64
    7. CPU op-mode(s): 32-bit, 64-bit
    8. Byte Order: Little Endian
    9. CPU(s): 3
    10. On-line CPU(s) list: 0-2
    11. Thread(s) per core: 1
    12. Core(s) per socket: 3
    13. Socket(s): 1
    14. NUMA node(s): 1
    15. Vendor ID: GenuineIntel
    16. CPU family: 6
    17. Model: 142
    18. Model name: Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    19. Stepping: 10
    20. CPU MHz: 1991.997
    21. BogoMIPS: 3983.99
    22. Hypervisor vendor: KVM
    23. Virtualization type: full
    24. L1d cache: 32K
    25. L1i cache: 32K
    26. L2 cache: 256K
    27. L3 cache: 8192K
    28. NUMA node0 CPU(s): 0-2
    29. Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 h
    30. t syscall nx rdtscp lm constant_tsc rep_good nopl xtopology nonstop_tsc cpuid tsc_known_freq pni pclmulqdq ssse3 cx16 pc
    31. id sse4_1 sse4_2 movbe popcnt aes xsave avx rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single pti fsgsbase avx2
    32. invpcid rdseed clflushopt flush_l1d
    33.  

    I have a very basic Unity 2019.2.11f1 project setup at C:/Projekt/SamleTestingProject.
    It only contains one playmode testing assembly (.asmdef) with one testing file (.cs) containing two very basic tests.
    One with Assert.Pass() and one with Assert.Fail(), for testing purposes.

    Command used

    To start the container:

    Code (powershell):
    1.  
    2. # Volume specified using Oracle VirtualBox "syntax"
    3. docker run --rm -it -v /c/Projekt/SamleTestingProject:/root/repo gableroux/unity3d:2019.2.11f1
    4.  
    To run the tests:

    Code (bash):
    1.  
    2. TEST_PROJECT=/root/repo2
    3. TEST_PLATFORM=StandaloneLinux64
    4.  
    5. # Copying to not use volume, for sanity check (some forum posts/stackoverflow posts say that could cause problems)
    6. cp -r /root/repo $TEST_PROJECT
    7. chmod -R 777 $TEST_PROJECT
    8.  
    9. xvfb-run -as '-screen 0 640x480x24' /opt/Unity/Editor/Unity \
    10.     -projectPath $TEST_PROJECT \
    11.     -runTests \
    12.     -testPlatform StandaloneLinux64 \
    13.     -testResults $TEST_PROJECT/test-results-StandaloneLinux64.xml \
    14.     -buildTarget Linux64 \
    15.     -batchmode \
    16.     -logfile /dev/stdout
    17.  
    Results in

    Long build log which then freezes just when it should be about to start testing. It's just halted doing nothing.

    Full log @ pastebin (2261 lines)

    Changing the above script to use
    TEST_PLATFORM=playmode
    instead of StandaloneLinux64, then everything works and results in a
    test-results-playmode.xml
    containing most notably:

    Code (xml):
    1. <test-suite /.../ total="2" passed="1" failed="1" inconclusive="0" skipped="0" /.../ >
    Don't really know what could be the problem here. Any help is much appreciated!