Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -2662,6 +2662,26 @@ def test_remote_ports(self):
# Emdawnwebgpu uses C++ internally, so we use a cpp file here so emcc defaults to linking C++.
self.emcc('hello_world.cpp', ['--use-port=emdawnwebgpu'])

def test_port_lock_contention(self):
if config.FROZEN_CACHE:
self.skipTest("test doesn't work with frozen cache")
self.run_process([EMBUILDER, 'clear', '--wasm64', 'emdawnwebgpu'])
with cache.lock('clean port'):
utils.delete_dir(os.path.join(config.PORTS, 'emdawnwebgpu'))
create_file('CMakeLists.txt', '''
cmake_minimum_required(VERSION 3.16)
file(GLOB MY_SOURCES "*.c")
set(CMAKE_C_FLAGS "-sMEMORY64 --use-port=emdawnwebgpu")

add_library(cpp_lib ${CPP_LIBRARY_TYPE} ${MY_SOURCES})
''')
for i in range(100):
create_file(f'file{i}.c', f'int v{i} = {i};')
self.run_process([EMCMAKE, 'cmake', '-G', 'Ninja'])
# All of the the 100 subprocesses should attempt downlowd emdawnwebgpu, but only one
# will actually do it.
self.run_process(['ninja', '-v'])

@crossplatform
def test_external_ports_simple(self):
if config.FROZEN_CACHE:
Expand Down
Loading