• Stars
    star
    10
  • Rank 1,807,489 (Top 36 %)
  • Language
    Go
  • License
    MIT License
  • Created about 4 years ago
  • Updated 6 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
778
star
2

Github-Release-Action

Publish Github releases in an action
Shell
166
star
3

go-localstack

Go Wrapper for using localstack
Go
76
star
4

ecr-login-action

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

cf-jetbrains-license-server

JetBrains License Server for Cloud Foundry
Shell
32
star
6

gcloud-login-action

A Github Action which can be used to authenticate with Google Cloud Container Registry
Shell
22
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

EPEX-DE-History

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

github-globe

Python
3
star
13

asdf-build-action

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

semv

Working with semvers
Go
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

DataInspector

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

elgohr

Profile Readme
1
star
20

git-docker

Everything you need for Github/Git
Dockerfile
1
star
21

go-cryptotokenkit

Go wrapper for Apple CryptoTokenKit
Go
1
star
22

tinygo-wasm

A WASM bootstrap with tinygo
JavaScript
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