mirror of
https://github.com/digital-asset/daml.git
synced 2024-09-20 09:17:43 +03:00
a1da025b78
* Test case for LockedFreePort not colliding with port 0 changelog_begin changelog_end * Discover dynamic port range on Linux * Random port generator outside ephemeral range * remove dev comments * Draw FreePort from outside the ephemeral port range Note, there is a race condition between the socket being closed and the lock-file being created in LockedFreePort. This is not a new issue, it was already present with the previous port 0 based implementation. LockedFreePort handles this by attempting to find a free port and taking a file lock multiple times. But, it could happen that A `find`s port N, and obtains the lock, but doesn't bind port N again, yet; then B binds port N during `find`; then A attempts to bind port N before B could release it again and fails because B still holds it. * Select dynamic port range based on OS * Detect dynamic port range on MacOS and Windows * Import sysctl from Nix on MacOS changelog_begin changelog_end * Windows line separator * FreePort helpers visibility * Use more informative exception types * Use a more light weight unit test * Add comments * Fix Windows * Update libs-scala/ports/src/main/scala/com/digitalasset/ports/FreePort.scala Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com> * Update libs-scala/ports/src/main/scala/com/digitalasset/ports/FreePort.scala Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com> * Add a comment to clarify the generated port range * fmt * unused import * Split libs-scala/ports Splits the FreePort and LockedFreePort components into a separate library as this is only used for testing purposes. Co-authored-by: Andreas Herrmann <andreas.herrmann@tweag.io> Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
28 lines
798 B
Python
28 lines
798 B
Python
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
load(
|
|
"//bazel_tools:scala.bzl",
|
|
"da_scala_library",
|
|
)
|
|
|
|
da_scala_library(
|
|
name = "non-repudiation-testing",
|
|
srcs = glob(["src/main/scala/**/*.scala"]),
|
|
scala_deps = [
|
|
"@maven//:org_scala_lang_modules_scala_collection_compat",
|
|
],
|
|
visibility = [
|
|
"//:__subpackages__",
|
|
],
|
|
deps = [
|
|
"//ledger-api/grpc-definitions:ledger_api_proto_scala",
|
|
"//libs-scala/ports",
|
|
"//libs-scala/ports:ports-testing",
|
|
"//runtime-components/non-repudiation",
|
|
"//runtime-components/non-repudiation-client",
|
|
"@maven//:io_grpc_grpc_netty",
|
|
"@maven//:io_grpc_grpc_services",
|
|
],
|
|
)
|