You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: testutil.go
    path of file: ./repos/FerretDB/internal/util/testutil
    
    the code of the file until where you have to start completion: // Copyright 2021 FerretDB Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use 
    
func Ctx(tb testtb.TB) context.Context {
	tb.Helper()

	signalsCtx, signalsStop := ctxutil.SigTerm(context.Background())

	testDone := make(chan struct{})

	tb.Cleanup(func() {
		close(testDone)
	})

	go func() {
		select {
		case <-testDone:
			signalsStop()

		case <-signalsCtx.Done():
			// There is a weird interaction between terminal's process group/session signal handling,
			// Task's signal handling,
			// and this attempt to handle signals gracefully.
			// It may cause tests to continue running in the background
			// while terminal shows command-line prompt already.
			//
			// Panic to surely stop tests.
			panic("Stopping everything")
		}
	}()

	ctx, span := otel.Tracer("").Start(signalsCtx, tb.Name())
	tb.Cleanup(func() {
		span.End()
	})

	ctx, task := trace.NewTask(ctx, tb.Name())
	tb.Cleanup(task.End)

	return ctx
}