dotnet / dotnet/Docker.DotNet

Tests fail with socket exception.netcore 2.1 docker

Open
#400 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
2.4k
Forks
416
PR merge metrics
No merged PRs in 30d

Description

Trying to run Specflow tests inside a docker container but the tests crash with socket exception.

```
root@de34c5753f64:/sportsbook-functional-tests# dotnet test
-> Using default config
Test run for /sportsbook-functional-tests/SbAutomation/bin/Debug/netcoreapp2.1/SbAutomation.dll(.NETCoreApp,Version=v2.1)
Microsoft (R) Test Execution Command Line Tool Version 16.1.0
Copyright (c) Microsoft Corporation. All rights reserved.

Starting test execution, please wait...
Test run in progress.***********************
*** Evaluation mode ***
***********************

The current user does not have a license assigned.
This version can be used for evaluation purposes only.
For obtaining a registered license please visit http://www.specflow.org/plus.
The active test run was aborted. Reason: Test host process crashed : Unhandled Exception: System.Net.Sockets.SocketException: Operation canceled
at System.IO.Pipes.NamedPipeServerStream.g__WaitForConnectionAsyncCore|23_0()
at System.Threading.Tasks.TaskToApm.End(IAsyncResult asyncResult)
at TechTalk.SpecFlow.Plus.RPC.Server.<>c__DisplayClass9_0.b__0(IAsyncResult ar)
at System.Threading.Tasks.TaskToApm.<>c__DisplayClass3_0.b__0()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
at System.Threading.ThreadPoolWorkQueue.Dispatch()


Test Run Aborted.
Total tests: Unknown
Passed: 1
Total time: 36.4378 Seconds
```
**Dockerfile**
```
FROM microsoft/dotnet:2.1-sdk-stretch
USER root

ADD https://dl.google.com/linux/direct/google-talkplugin_current_amd64.deb /src/google-talkplugin_current_amd64.deb

RUN apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg \
hicolor-icon-theme \
libcanberra-gtk* \
libgl1-mesa-dri \
libgl1-mesa-glx \
libpango1.0-0 \
libpulse0 \
libv4l-0 \
unzip \
fonts-symbola \
--no-install-recommends

RUN curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb
RUN dpkg -i /chrome.deb || apt-get install -yf
RUN rm /chrome.deb
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.