Rod Hynes 5 лет назад
Родитель
Сommit
2dbed13382
1 измененных файлов с 19 добавлено и 19 удалено
  1. 19 19
      psiphon/server/server_test.go

+ 19 - 19
psiphon/server/server_test.go

@@ -1282,6 +1282,25 @@ func runServer(t *testing.T, runConfig *runServerConfig) {
 	checkPruneServerEntriesTest(t, runConfig, testDataDirName, pruneServerEntryTestCases)
 }
 
+func sendNotificationReceived(c chan<- struct{}) {
+	select {
+	case c <- struct{}{}:
+	default:
+	}
+}
+
+func waitOnNotification(t *testing.T, c, timeoutSignal <-chan struct{}, timeoutMessage string) {
+	if timeoutSignal == nil {
+		<-c
+	} else {
+		select {
+		case <-c:
+		case <-timeoutSignal:
+			t.Fatalf(timeoutMessage)
+		}
+	}
+}
+
 func checkExpectedServerTunnelLogFields(
 	runConfig *runServerConfig,
 	expectClientBPFField bool,
@@ -2136,25 +2155,6 @@ func paveBlocklistFile(t *testing.T, blocklistFilename string) {
 	}
 }
 
-func sendNotificationReceived(c chan<- struct{}) {
-	select {
-	case c <- struct{}{}:
-	default:
-	}
-}
-
-func waitOnNotification(t *testing.T, c, timeoutSignal <-chan struct{}, timeoutMessage string) {
-	if timeoutSignal == nil {
-		<-c
-	} else {
-		select {
-		case <-c:
-		case <-timeoutSignal:
-			t.Fatalf(timeoutMessage)
-		}
-	}
-}
-
 type pruneServerEntryTestCase struct {
 	IPAddress         string
 	ExplicitTag       bool