• Stars
    star
    10
  • Rank 1,747,726 (Top 36 %)
  • Language
    Go
  • License
    MIT License
  • Created over 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Testing helper for concurrency

stop-and-go

Actions Status codecov Go Report Card PkgGoDev License: MIT

Testing helper for concurrency

Install

go get -u github.com/elgohr/stop-and-go

Usage

func TestExample(t *testing.T) {
	w1 := wait.NewWaiter(time.Second)
	w2 := wait.NewWaiter(time.Second)
	w3 := wait.NewWaiter(time.Second)

	ts1 := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		w.WriteHeader(http.StatusOK)
		w2.Done()
	}))
	defer ts1.Close()

	go func() {
		w3.Done()
	}()

	go func() {
		if _, err := http.Get(ts1.URL); err != nil {
			t.Error(err)
		}
		w1.Done()
	}()

	if err := wait.For(
		constraint.NoOrder(w3),
		constraint.Before(w1, w2),
	); err != nil {
		t.Error(err)
	}
}

More Repositories

1

Publish-Docker-Github-Action

A Github Action used to build and publish Docker images
Shell
768
star
2

Github-Release-Action

Publish Github releases in an action
Shell
153
star
3

go-localstack

Go Wrapper for using localstack
Go
74
star
4

ecr-login-action

A Github Action which can be used to authenticate with AWS ECR
Shell
38
star
5

cf-jetbrains-license-server

JetBrains License Server for Cloud Foundry
Shell
31
star
6

gcloud-login-action

A Github Action which can be used to authenticate with Google Cloud Container Registry
Shell
21
star
7

Github-Hub-Action

Interacting with Github in an action
Dockerfile
14
star
8

concourse-sonarqube-notifier

Concourse CI Resource for getting results from Sonarqube.
Go
8
star
9

concourse-blackduck

This is a Concourse resource for Blackduck
Go
6
star
10

mqtt-to-influxdb

Bridge to write MQTT to InfluxDB
Go
5
star
11

asdf-build-action

Uses ASDF to provide a configurable build environment for Github Actions
Dockerfile
3
star
12

EPEX-DE-History

This repository contains historic data from EPEX spot market for Germany, gotten by awattar.de
Python
3
star
13

semv

Working with semvers
Go
2
star
14

github-globe

Python
2
star
15

go-map-ttl

A map where elements expire after time
Go
2
star
16

acr-login-action

Logs into Azure Container Registry and provides Docker credentials
Shell
2
star
17

go-test-it-yourself

Content for a 42Wolfsburg Workshop
Go
2
star
18

tinygo-wasm

A WASM bootstrap with tinygo
JavaScript
1
star
19

DataInspector

Publishes the metadata of Spring Boot Entities to an endpoint
Groovy
1
star
20

git-docker

Everything you need for Github/Git
Dockerfile
1
star
21

elgohr

Profile Readme
1
star
22

go-cryptotokenkit

Go wrapper for Apple CryptoTokenKit
Go
1
star
23

go-stream

A collection of Go Readers and Writers for working with big amounts of data.
Go
1
star
24

gron-docker

Make JSON greppable in Docker
Dockerfile
1
star