Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 6 of 6 for waitCondition (0.34 sec)

  1. src/net/http/main_test.go

    		// shutting down, so give it some time.
    		time.Sleep(1 * time.Millisecond)
    	}
    	t.Errorf("Test appears to have leaked %s:\n%s", bad, stacks)
    }
    
    // waitCondition waits for fn to return true,
    // checking immediately and then at exponentially increasing intervals.
    func waitCondition(t testing.TB, delay time.Duration, fn func(time.Duration) bool) {
    	t.Helper()
    	start := time.Now()
    	var since time.Duration
    	for !fn(since) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Apr 03 22:49:46 UTC 2024
    - 4.9K bytes
    - Viewed (0)
  2. src/database/sql/sql_test.go

    func waitForFree(t *testing.T, db *DB, want int) {
    	var numFree int
    	if !waitCondition(t, func() bool {
    		numFree = db.numFreeConns()
    		return numFree == want
    	}) {
    		t.Fatalf("free conns after hitting EOF = %d; want %d", numFree, want)
    	}
    }
    
    func waitForRowsClose(t *testing.T, rows *Rows) {
    	if !waitCondition(t, func() bool {
    		rows.closemu.RLock()
    		defer rows.closemu.RUnlock()
    		return rows.closed
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 111.6K bytes
    - Viewed (0)
  3. src/net/http/transport_test.go

    			t.Fatalf("%s: %v", name, err)
    		}
    		t.Logf("%s: ok (%q)", name, slurp)
    	}
    
    	doReq("first")
    	keys1 := tr.IdleConnKeysForTesting()
    
    	ts.CloseClientConnections()
    
    	var keys2 []string
    	waitCondition(t, 10*time.Millisecond, func(d time.Duration) bool {
    		keys2 = tr.IdleConnKeysForTesting()
    		if len(keys2) != 0 {
    			if d > 0 {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Jun 06 21:59:21 UTC 2024
    - 192.6K bytes
    - Viewed (0)
  4. src/net/http/clientserver_test.go

    	}
    	logOutput := func() string {
    		errorLog.Lock()
    		defer errorLog.Unlock()
    		return errorLog.String()
    	}
    	wantStackLogged := panicValue != nil && panicValue != ErrAbortHandler
    
    	waitCondition(t, 10*time.Millisecond, func(d time.Duration) bool {
    		gotLog := logOutput()
    		if !wantStackLogged {
    			if gotLog == "" {
    				return true
    			}
    			t.Fatalf("want no log output; got: %s", gotLog)
    		}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 01:00:11 UTC 2024
    - 46.6K bytes
    - Viewed (0)
  5. src/net/http/serve_test.go

    		t.Errorf("found %d idle conns (%q); want 1", len(conns), conns)
    	}
    
    	// SetKeepAlivesEnabled should discard idle conns.
    	ts.Config.SetKeepAlivesEnabled(false)
    
    	waitCondition(t, 10*time.Millisecond, func(d time.Duration) bool {
    		if conns := tr.IdleConnStrsForTesting(); len(conns) > 0 {
    			if d > 0 {
    				t.Logf("idle conns %v after SetKeepAlivesEnabled called = %q; waiting for empty", d, conns)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri Jun 07 17:57:01 UTC 2024
    - 202K bytes
    - Viewed (0)
  6. pkg/controller/job/job_controller_test.go

    			if tc.wantConditions != nil {
    				for _, wantCondition := range *tc.wantConditions {
    					conditions := getConditionsByType(actual.Status.Conditions, wantCondition.Type)
    					if len(conditions) != 1 {
    						t.Fatalf("Expected a single completion condition. Got %#v for type: %q", conditions, wantCondition.Type)
    					}
    					condition := *conditions[0]
    Registered: Sat Jun 15 01:39:40 UTC 2024
    - Last Modified: Tue Jun 11 15:36:36 UTC 2024
    - 229.2K bytes
    - Viewed (0)
Back to top