mirror of
				https://github.com/eledio-devices/thirdparty-littlefs.git
				synced 2025-10-31 00:32:38 +01:00 
			
		
		
		
	Fixed Popen deadlock issue in test.py
As noted in Python's subprocess library: > This will deadlock when using stdout=PIPE and/or stderr=PIPE and the > child process generates enough output to a pipe such that it blocks > waiting for the OS pipe buffer to accept more data. Curiously, this only became a problem when updating to Ubuntu 20.04 in CI (python3.6 -> python3.8).
This commit is contained in:
		
							
								
								
									
										26
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										26
									
								
								.github/workflows/test.yml
									
									
									
									
										vendored
									
									
								
							| @@ -19,11 +19,27 @@ jobs: | |||||||
|       - name: install |       - name: install | ||||||
|         run: | |         run: | | ||||||
|           # need a few additional tools |           # need a few additional tools | ||||||
|  |           # | ||||||
|  |           # note this includes gcc-10, which is required for -fcallgraph-info=su | ||||||
|           sudo apt-get update -qq |           sudo apt-get update -qq | ||||||
|           sudo apt-get install -qq python3 python3-pip lcov |           sudo apt-get install -qq gcc-10 python3 python3-pip lcov | ||||||
|           sudo pip3 install toml |           sudo pip3 install toml | ||||||
|  |           echo "CC=gcc-10" >> $GITHUB_ENV | ||||||
|  |           gcc-10 --version | ||||||
|  |           lcov --version | ||||||
|           python3 --version |           python3 --version | ||||||
|  |  | ||||||
|  |           # need newer lcov version for gcc-10 | ||||||
|  |           #sudo apt-get remove lcov | ||||||
|  |           #wget https://launchpad.net/ubuntu/+archive/primary/+files/lcov_1.15-1_all.deb | ||||||
|  |           #sudo apt install ./lcov_1.15-1_all.deb | ||||||
|  |           #lcov --version | ||||||
|  |           #which lcov | ||||||
|  |           #ls -lha /usr/bin/lcov | ||||||
|  |           wget https://github.com/linux-test-project/lcov/releases/download/v1.15/lcov-1.15.tar.gz | ||||||
|  |           tar xf lcov-1.15.tar.gz | ||||||
|  |           sudo make -C lcov-1.15 install | ||||||
|  |  | ||||||
|           # setup a ram-backed disk to speed up reentrant tests |           # setup a ram-backed disk to speed up reentrant tests | ||||||
|           mkdir disks |           mkdir disks | ||||||
|           sudo mount -t tmpfs -o size=100m tmpfs disks |           sudo mount -t tmpfs -o size=100m tmpfs disks | ||||||
| @@ -36,14 +52,6 @@ jobs: | |||||||
|  |  | ||||||
|           echo "TESTFLAGS=$TESTFLAGS" >> $GITHUB_ENV |           echo "TESTFLAGS=$TESTFLAGS" >> $GITHUB_ENV | ||||||
|  |  | ||||||
|       # we're not cross-compiling with x86, but we do need the newest |  | ||||||
|       # version of gcc for the -fcallgraph-info=su flag |  | ||||||
|       - name: install-x86_64 |  | ||||||
|         if: ${{matrix.arch == 'x86_64'}} |  | ||||||
|         run: | |  | ||||||
|           sudo apt-get install -qq gcc-10 |  | ||||||
|           echo "CC=gcc-10" >> $GITHUB_ENV |  | ||||||
|           gcc-10 --version |  | ||||||
|       # cross-compile with ARM Thumb (32-bit, little-endian) |       # cross-compile with ARM Thumb (32-bit, little-endian) | ||||||
|       - name: install-thumb |       - name: install-thumb | ||||||
|         if: ${{matrix.arch == 'thumb'}} |         if: ${{matrix.arch == 'thumb'}} | ||||||
|   | |||||||
| @@ -784,10 +784,13 @@ def main(**args): | |||||||
|             stdout=sp.PIPE if not args.get('verbose') else None, |             stdout=sp.PIPE if not args.get('verbose') else None, | ||||||
|             stderr=sp.STDOUT if not args.get('verbose') else None, |             stderr=sp.STDOUT if not args.get('verbose') else None, | ||||||
|             universal_newlines=True) |             universal_newlines=True) | ||||||
|  |         stdout = [] | ||||||
|  |         for line in proc.stdout: | ||||||
|  |             stdout.append(line) | ||||||
|         proc.wait() |         proc.wait() | ||||||
|         if proc.returncode != 0: |         if proc.returncode != 0: | ||||||
|             if not args.get('verbose'): |             if not args.get('verbose'): | ||||||
|                 for line in proc.stdout: |                 for line in stdout: | ||||||
|                     sys.stdout.write(line) |                     sys.stdout.write(line) | ||||||
|             sys.exit(-1) |             sys.exit(-1) | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user