Просмотр исходного кода

Improve test reliability

- TestDuplicateSessionID intermittently failed, on multiple
  platforms and hosts, due to "too many open files"
Rod Hynes 6 лет назад
Родитель
Сommit
6473ebcd6a
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      psiphon/server/sessionID_test.go

+ 5 - 2
psiphon/server/sessionID_test.go

@@ -69,7 +69,7 @@ func TestDuplicateSessionID(t *testing.T) {
 
 	serverConfigJSON, _ = json.Marshal(serverConfig)
 
-	numConcurrentClients := 100
+	numConcurrentClients := 50
 
 	stoppingEvent := "stopping existing client with duplicate session ID"
 	abortingEvent := "aborting new client with duplicate session ID"
@@ -243,7 +243,7 @@ func TestDuplicateSessionID(t *testing.T) {
 	t1.Close(true)
 	t2.Close(true)
 
-	// Test: 100 concurrent clients, all with the same session ID.
+	// Test: 50 concurrent clients, all with the same session ID.
 	//
 	// This should be enough concurrent clients to trigger both the "stopping"
 	// and "aborting" duplicate session ID cases.
@@ -261,6 +261,9 @@ func TestDuplicateSessionID(t *testing.T) {
 	waitGroup.Wait()
 
 	for _, t := range tunnels {
+		if t == nil {
+			continue
+		}
 		t.Close(true)
 	}